DRAFT

javax.interceptor
Interface InvocationContext


public interface InvocationContext

Context information passed to AroundInvoke and Interceptor-class lifecycle callback methods.


Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getContextData()
          Returns the context data associated with this invocation or lifecycle callback.
 java.lang.reflect.Method getMethod()
          Returns the method of the bean class for which the interceptor was invoked.
 java.lang.Object[] getParameters()
          Returns the parameters that will be used to invoke the business method.
 java.lang.Object getTarget()
          Returns the target instance.
 java.lang.Object getTimer()
          Returns the Timer object associated with a timeout method invocation.
 java.lang.Object proceed()
          Proceed to the next entry in the interceptor chain.
 void setParameters(java.lang.Object[] params)
          Sets the parameters that will be used to invoke the business method.
 

Method Detail

getTarget

java.lang.Object getTarget()
Returns the target instance.


getTimer

java.lang.Object getTimer()
Returns the Timer object associated with a timeout method invocation. Returns null for around-invoke methods and lifecycle callback interceptor methods


getMethod

java.lang.reflect.Method getMethod()
Returns the method of the bean class for which the interceptor was invoked. For AroundInvoke methods, this is the business method on the bean class. For lifecycle callback methods, returns null.


getParameters

java.lang.Object[] getParameters()
Returns the parameters that will be used to invoke the business method. If setParameters has been called, getParameters() returns the values to which the parameters have been set.

Throws:
java.lang.IllegalStateException - if invoked within a lifecycle callback method.

setParameters

void setParameters(java.lang.Object[] params)
Sets the parameters that will be used to invoke the business method.

Throws:
java.lang.IllegalStateException - if invoked within a lifecycle callback method.
java.lang.IllegalArgumentException - if the parameter types do not match the types for the business method, or the number of parameters supplied does not equal the number of parameters for the business method.

getContextData

java.util.Map<java.lang.String,java.lang.Object> getContextData()
Returns the context data associated with this invocation or lifecycle callback. If there is no context data, an empty Map object will be returned.


proceed

java.lang.Object proceed()
                         throws java.lang.Exception
Proceed to the next entry in the interceptor chain. The proceed method returns the result of the next method invoked. If the method returns void, proceed returns null.

Throws:
java.lang.Exception

DRAFT

Submit a bug or feature

Copyright © 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.

Generated on 3-November-2009 04:04