public class InterceptorInvocationContext extends Object implements InvocationContext
Constructor and Description |
---|
InterceptorInvocationContext(InterceptionChain interceptionChain,
Constructor<?> constructor,
Object[] parameters,
Map<String,Object> contextData) |
InterceptorInvocationContext(InterceptionChain interceptionChain,
Object target,
Method targetMethod,
Object timer) |
InterceptorInvocationContext(InterceptionChain interceptionChain,
Object target,
Method targetMethod,
Object[] parameters) |
Modifier and Type | Method and Description |
---|---|
Constructor<?> |
getConstructor()
Returns the constructor of the target class for which the interceptor
was invoked.
|
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()
Proceed with the next stage of invocation processing.
|
void |
setParameters(Object[] params)
Replace the parameters of the method invocation.
|
public InterceptorInvocationContext(InterceptionChain interceptionChain, Object target, Method targetMethod, Object[] parameters)
public InterceptorInvocationContext(InterceptionChain interceptionChain, Object target, Method targetMethod, Object timer)
public InterceptorInvocationContext(InterceptionChain interceptionChain, Constructor<?> constructor, Object[] parameters, Map<String,Object> contextData)
public Map<String,Object> getContextData()
InvocationContext
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 InvocationContext
public Method getMethod()
InvocationContext
@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 InvocationContext
null
if none applies to the current invocation contextpublic Object[] getParameters()
InvocationContext
getParameters
in interface InvocationContext
public Object getTarget()
InvocationContext
getTarget
in interface InvocationContext
public Object proceed() throws Exception
InvocationContext
If the intercepted method's return type is void
, or if this is a lifecycle method interceptor, then
null
is returned from this method, and should be returned by the interceptor as well.
proceed
in interface InvocationContext
Exception
- if an exception is thrown by subsequent processingpublic void setParameters(Object[] params)
InvocationContext
setParameters
in interface InvocationContext
params
- the new parameter values to use for the current invocationpublic Object getTimer()
InvocationContext
@AroundTimeout
interceptor method. When intercepting
an EJB component timeout, the returned type is javax.ejb.Timer
.getTimer
in interface InvocationContext
null
if the invocation did not apply to a timeout method.public Constructor<?> getConstructor()
InvocationContext
AroundConstruct
interceptor, the constructor of the
target class is returned. For all other interceptors,
a null value is returned.getConstructor
in interface InvocationContext
Copyright © 2013 Seam Framework. All Rights Reserved.