Package org.jboss.invocation
Class SimpleInvocationContext
- java.lang.Object
-
- org.jboss.invocation.SimpleInvocationContext
-
- All Implemented Interfaces:
jakarta.interceptor.InvocationContext
public class SimpleInvocationContext extends Object implements jakarta.interceptor.InvocationContext
A base class for invocation contexts. Also can act as the last interceptor in a chain which does not proceed.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description SimpleInvocationContext(Object target, Method method, Object[] parameters)Construct a new instance.SimpleInvocationContext(Object target, Method method, Object[] parameters, Object timer)Construct a new instance.SimpleInvocationContext(Object target, Method method, Object[] parameters, Map<String,Object> contextData, Object timer, Constructor<?> constructor)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Constructor<?>getConstructor()Map<String,Object>getContextData()MethodgetMethod()Object[]getParameters()ObjectgetTarget()ObjectgetTimer()Objectproceed()Throw an exception indicating that the end of the interceptor chain was reached without an invocation being performed.voidsetParameters(Object[] parameters)
-
-
-
Constructor Detail
-
SimpleInvocationContext
public SimpleInvocationContext(Object target, Method method, Object[] parameters, Map<String,Object> contextData, Object timer, Constructor<?> constructor)
Construct a new instance.- Parameters:
target- the target object instancemethod- the invocation method (may benull)parameters- the invocation parameters (may benull)contextData- the context data map to usetimer- the associated timer (may benull)
-
SimpleInvocationContext
public SimpleInvocationContext(Object target, Method method, Object[] parameters, Object timer)
Construct a new instance.- Parameters:
target- the target object instancemethod- the invocation method (may benull)parameters- the invocation parameters (may benull)timer- the associated timer (may benull)
-
-
Method Detail
-
getTarget
public Object getTarget()
- Specified by:
getTargetin interfacejakarta.interceptor.InvocationContext
-
getMethod
public Method getMethod()
- Specified by:
getMethodin interfacejakarta.interceptor.InvocationContext
-
getParameters
public Object[] getParameters()
- Specified by:
getParametersin interfacejakarta.interceptor.InvocationContext
-
setParameters
public void setParameters(Object[] parameters)
- Specified by:
setParametersin interfacejakarta.interceptor.InvocationContext
-
getContextData
public Map<String,Object> getContextData()
- Specified by:
getContextDatain interfacejakarta.interceptor.InvocationContext
-
getTimer
public Object getTimer()
- Specified by:
getTimerin interfacejakarta.interceptor.InvocationContext
-
proceed
public Object proceed() throws Exception
Throw an exception indicating that the end of the interceptor chain was reached without an invocation being performed. This method should be overridden to provide a specific implementation. Though this method always throwsCannotProceedException, it is declared to throwExceptionso that subclasses can override this method in a spec-compliant way.- Specified by:
proceedin interfacejakarta.interceptor.InvocationContext- Returns:
- nothing
- Throws:
Exception- always (in particular,CannotProceedException)
-
getConstructor
public Constructor<?> getConstructor()
- Specified by:
getConstructorin interfacejakarta.interceptor.InvocationContext
-
-