public class ReflectionInvocationContext extends java.lang.Object implements InvocationContext
Constructor and Description |
---|
ReflectionInvocationContext(Operation operation,
java.util.List<Interceptor> interceptors,
java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object... parameters) |
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Constructor<?> |
getConstructor()
Returns the constructor of the target class for which the
AroundConstruct interceptor method was invoked. |
java.util.Map<java.lang.String,java.lang.Object> |
getContextData()
Enables an interceptor to retrieve or update the data associated with the invocation by another interceptor, business
method, and/or webservices endpoint in the invocation chain.
|
java.lang.reflect.Method |
getMethod()
Returns the method of the target class for which the interceptor was invoked.
|
java.lang.Object[] |
getParameters()
Returns the parameter values that will be passed to the method or constructor of the target class.
|
java.lang.Object |
getTarget()
Returns the target instance.
|
java.lang.Object |
getTimer()
Returns the timer object associated with a timeout method invocation on the target class, or a null value for
interceptor method types other than
AroundTimeout . |
java.lang.Object |
proceed()
Proceed to the next interceptor in the interceptor chain.
|
void |
setParameters(java.lang.Object[] parameters)
Sets the parameter values that will be passed to the method or constructor of the target class.
|
java.lang.String |
toString() |
public ReflectionInvocationContext(Operation operation, java.util.List<Interceptor> interceptors, java.lang.Object target, java.lang.reflect.Method method, java.lang.Object... parameters)
public java.lang.Object getTimer()
InvocationContext
AroundTimeout
. For example, when associated with an EJB component
timeout, this method returns Timer
.getTimer
in interface InvocationContext
public java.lang.Object getTarget()
InvocationContext
AroundConstruct
lifecycle callback interceptor methods, the
getTarget method returns null
if called before the InvocationContext.proceed()
method.getTarget
in interface InvocationContext
public java.lang.reflect.Method getMethod()
InvocationContext
AroundConstruct
lifecycle callback interceptor method.getMethod
in interface InvocationContext
public java.lang.reflect.Constructor<?> getConstructor()
InvocationContext
AroundConstruct
interceptor method was invoked.
Returns null for interceptor method types other than AroundConstruct
interceptor methods.getConstructor
in interface InvocationContext
public java.lang.Object[] getParameters()
InvocationContext
InvocationContext.setParameters(java.lang.Object[])
has been called, getParameters
returns the values to which the parameters have
been set.getParameters
in interface InvocationContext
public void setParameters(java.lang.Object[] parameters)
InvocationContext
setParameters
in interface InvocationContext
parameters
- the parameter values, as an arraypublic java.util.Map<java.lang.String,java.lang.Object> getContextData()
InvocationContext
javax.xml.rpc.handler.MessageContext
.getContextData
in interface InvocationContext
Map<String,Object>
object will be returned.public java.lang.Object proceed() throws java.lang.Exception
InvocationContext
proceed
in the last interceptor method in the chain causes the invocation of the target
class method. For AroundConstruct
lifecycle callback interceptor methods, the invocation of proceed
in the last interceptor method in the chain causes the target instance to be created. For all other lifecycle
callback interceptor methods, if there is no callback method defined on the target class, the invocation of proceed
in the last interceptor method in the chain is a no-op.
Return the result of the next method invoked, or a null value if the method has return type void.
proceed
in interface InvocationContext
java.lang.Exception
- if thrown by target method or interceptor method in call stackpublic java.lang.String toString()
toString
in class java.lang.Object