InvocationContext (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.interceptor Interface InvocationContext


public interface InvocationContext

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


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

方法详细信息

getTarget

Object getTarget()
Returns the target instance.


getMethod

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

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.

抛出异常:
IllegalStateException - if invoked within a lifecycle callback method.

setParameters

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

抛出异常:
IllegalStateException - if invoked within a lifecycle callback method.
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

Map<String,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

Object proceed()
               throws 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.

抛出异常:
Exception

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.