public final class InterceptorContext extends Object implements Cloneable, PrivilegedExceptionAction<Object>
Constructor and Description |
---|
InterceptorContext() |
Modifier and Type | Method and Description |
---|---|
InterceptorContext |
clone()
Clone this interceptor context instance.
|
Constructor<?> |
getConstructor()
Get the intercepted constructor.
|
Map<String,Object> |
getContextData()
Get the context data which is reported to the interceptor invocation context.
|
Interceptor[] |
getInterceptors()
Get the current interceptors.
|
List<Interceptor> |
getInterceptors$$bridge()
Binary compatibility bridge for interceptors list.
|
javax.interceptor.InvocationContext |
getInvocationContext()
Get the invocation context.
|
Method |
getMethod()
Get the invoked method which is reported to the interceptor invocation context.
|
int |
getNextInterceptorIndex()
Returns the next interceptor index.
|
Object[] |
getParameters()
Get the method parameters which are reported to the interceptor invocation context.
|
<T> T |
getPrivateData(Class<T> type)
Get a private data item.
|
Object |
getPrivateData(Object key)
Get a private data item.
|
Object |
getTarget()
Get the invocation target which is reported to the interceptor invocation context.
|
Object |
getTimer()
Get the timer object which is reported to the interceptor invocation context.
|
Transaction |
getTransaction()
Get the transaction for this invocation, if any.
|
boolean |
hasTransaction()
Determine if a transaction supplier was established for this invocation.
|
boolean |
isBlockingCaller()
Determine whether this invocation is currently directly blocking the calling thread.
|
Object |
proceed()
Pass the invocation on to the next step in the chain.
|
<T> T |
putPrivateData(Class<T> type,
T value)
Insert a private data item.
|
Object |
putPrivateData(Object key,
Object value)
Insert a private data item.
|
Object |
run()
Synonymous with
proceed() ; exists to implement PrivilegedExceptionAction . |
void |
setBlockingCaller(boolean blockingCaller)
Establish whether this invocation is currently directly blocking the calling thread.
|
void |
setConstructor(Constructor<?> constructor)
Set the intercepted constructor.
|
void |
setContextData(Map<String,Object> contextData)
Set the context data which is reported to the interceptor invocation context.
|
void |
setInterceptors(Interceptor[] interceptors)
Set the interceptor iterator.
|
void |
setInterceptors(Interceptor[] interceptors,
int nextIndex)
Set the interceptors, with a starting index to proceed from.
|
void |
setInterceptors(List<Interceptor> interceptorList)
Set the interceptor array from a list.
|
void |
setInterceptors(List<Interceptor> interceptorList,
int nextIndex)
Set the interceptors, with a starting index to proceed from.
|
void |
setMethod(Method method)
Set the invoked method which is reported to the interceptor invocation context.
|
void |
setParameters(Object[] parameters)
Set the method parameters which are reported to the interceptor invocation context.
|
void |
setTarget(Object target)
Set the invocation target which is reported to the interceptor invocation context.
|
void |
setTimer(Object timer)
Set the timer object which is reported to the interceptor invocation context.
|
void |
setTransaction(Transaction transaction)
Set the transaction for the invocation.
|
void |
setTransactionSupplier(org.wildfly.common.function.ExceptionSupplier<Transaction,SystemException> transactionSupplier)
Set the transaction supplier for the invocation.
|
public Object getTarget()
public void setTarget(Object target)
target
- the invocation targetpublic Method getMethod()
public void setMethod(Method method)
method
- the methodpublic Constructor<?> getConstructor()
public void setConstructor(Constructor<?> constructor)
constructor
- the constructorpublic Object[] getParameters()
public void setParameters(Object[] parameters)
parameters
- the method parameterspublic Map<String,Object> getContextData() throws IllegalStateException
IllegalStateException
- if the context data was never initializedpublic void setContextData(Map<String,Object> contextData)
contextData
- the context datapublic Object getTimer()
public void setTimer(Object timer)
timer
- the timer objectpublic javax.interceptor.InvocationContext getInvocationContext()
public boolean hasTransaction()
true
if there is an enclosing transaction, false
otherwisepublic Transaction getTransaction() throws SystemException
null
if there is no transactionSystemException
- if the transaction import failedpublic void setTransaction(Transaction transaction)
null
, then there is no enclosing transaction.transaction
- the transaction for the invocationpublic void setTransactionSupplier(org.wildfly.common.function.ExceptionSupplier<Transaction,SystemException> transactionSupplier)
null
, then there is no enclosing transaction. The
supplier must not return null
.transactionSupplier
- the transaction supplier, or null
to clear the present transactionpublic <T> T getPrivateData(Class<T> type)
T
- the data typetype
- the data type class objectnull
if no such item existspublic Object getPrivateData(Object key)
key
- the object keypublic <T> T putPrivateData(Class<T> type, T value)
T
- the data typetype
- the data type class objectvalue
- the data item value, or null
to remove the mappingnull
if no such item existspublic Object putPrivateData(Object key, Object value)
Class
then the value given must be assignable to that class.key
- the data keyvalue
- the data item value, or null
to remove the mappingnull
if no such item existspublic boolean isBlockingCaller()
true
if the calling thread is being blocked; false
otherwisepublic void setBlockingCaller(boolean blockingCaller)
blockingCaller
- true
if the calling thread is being blocked; false
otherwisepublic Interceptor[] getInterceptors()
public List<Interceptor> getInterceptors$$bridge()
public int getNextInterceptorIndex()
public void setInterceptors(Interceptor[] interceptors)
interceptors
- the interceptor listpublic void setInterceptors(List<Interceptor> interceptorList)
interceptorList
- the interceptor listpublic void setInterceptors(Interceptor[] interceptors, int nextIndex)
interceptors
- the interceptor arraynextIndex
- the next index to proceedpublic void setInterceptors(List<Interceptor> interceptorList, int nextIndex)
interceptorList
- the interceptor listnextIndex
- the next index to proceedpublic Object proceed() throws Exception
Exception
- if an invocation throws an exceptionpublic Object run() throws Exception
proceed()
; exists to implement PrivilegedExceptionAction
.public InterceptorContext clone()
Copyright © 2023 JBoss by Red Hat. All rights reserved.