public class SimpleInvocationContext extends Object implements InvocationContext
| Constructor and Description |
|---|
SimpleInvocationContext(Object target,
Method method,
Object[] parameters)
Construct a new instance.
|
SimpleInvocationContext(Object target,
Method method,
Object[] parameters,
Map<String,Object> contextData,
Object timer)
Construct a new instance.
|
SimpleInvocationContext(Object target,
Method method,
Object[] parameters,
Object timer)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getContextData()
Returns the context data associated with this invocation or lifecycle callback.
|
Method |
getMethod()
Get the invoked method for this invocation.
|
Object[] |
getParameters()
Get the parameters of the method invocation (for method interceptors).
|
Object |
getTarget()
Get the target instance for this invocation.
|
Object |
getTimer()
Get the timer associated with an
@AroundTimeout interceptor method. |
Object |
proceed()
Throw an exception indicating that the end of the interceptor chain was reached without an invocation
being performed.
|
void |
setParameters(Object[] parameters)
Replace the parameters of the method invocation.
|
public SimpleInvocationContext(Object target, Method method, Object[] parameters, Map<String,Object> contextData, Object timer)
target - the target object instancemethod - the invocation method (may be null)parameters - the invocation parameters (may be null)contextData - the context data map to usetimer - the associated timer (may be null)public SimpleInvocationContext(Object target, Method method, Object[] parameters, Object timer)
target - the target object instancemethod - the invocation method (may be null)parameters - the invocation parameters (may be null)timer - the associated timer (may be null)public Object getTarget()
getTarget in interface InvocationContextpublic Method getMethod()
@AroundInvoke or
@AroundTimeout interceptor method, the method of the target class is returned. For
lifecycle callback interceptors (such as @PostConstruct or @PreDestroy), null is returned.getMethod in interface InvocationContextnull if none applies to the current invocation contextpublic Object[] getParameters()
getParameters in interface InvocationContextpublic void setParameters(Object[] parameters)
setParameters in interface InvocationContextparameters - the new parameter values to use for the current invocationpublic Map<String,Object> getContextData()
MessageContext. If there is no context data, an empty Map object will be returned. Normally,
information stored in this map is available to subsequent interceptors in an interceptor chain, so this mechanism
may be used to pass information from one interceptor to the next.getContextData in interface InvocationContextpublic Object getTimer()
@AroundTimeout interceptor method. When intercepting
an EJB component timeout, the returned type is Timer.getTimer in interface InvocationContextnull if the invocation did not apply to a timeout method.public Object proceed() throws Exception
CannotProceedException, it is declared to throw Exception so that subclasses
can override this method in a spec-compliant way.proceed in interface InvocationContextException - always (in particular, CannotProceedException)Copyright © 2012 JBoss by Red Hat. All Rights Reserved.