javax.interceptor
Interface InvocationContext


public interface InvocationContext

Context that is given to all interceptors (business or lifecycle) and that allow to get information on the current invocation.

Since:
EJB 3.0 version.
Author:
Florent Benoit
See Also:
EJB 3.0 specification

Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getContextData()
           
 java.lang.reflect.Method getMethod()
           
 java.lang.Object[] getParameters()
           
 java.lang.Object getTarget()
           
 java.lang.Object proceed()
          Call the next interceptor in the chain (and at the end it is the intercepted method that is called).
 void setParameters(java.lang.Object[] params)
          Sets the parameters of the method that is intercepted.
 

Method Detail

getTarget

java.lang.Object getTarget()
Returns:
the object on which the intercepted method is called.

getMethod

java.lang.reflect.Method getMethod()
Returns:
the method that is intercepted (null for lifecycle interceptors).

getParameters

java.lang.Object[] getParameters()
Returns:
the parameters of the intercepted method (if any)

setParameters

void setParameters(java.lang.Object[] params)
Sets the parameters of the method that is intercepted.

Parameters:
params - the array of parameters.

getContextData

java.util.Map<java.lang.String,java.lang.Object> getContextData()
Returns:
a Map that is shared by all interceptors for a given method.

proceed

java.lang.Object proceed()
                         throws java.lang.Exception
Call the next interceptor in the chain (and at the end it is the intercepted method that is called).

Returns:
the result of the invocation on the intercepted method.
Throws:
java.lang.Exception - if method invocation fails.


Copyright © 2008. All Rights Reserved.