|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.aop.joinpoint.InvocationBase org.jboss.aop.joinpoint.MethodInvocation org.jboss.aop.joinpoint.MethodInvocationWrapper
public class MethodInvocationWrapper
This wrapper class allows you to insert a chain of interceptors into the middle of a call stack.
Field Summary |
---|
Fields inherited from class org.jboss.aop.joinpoint.MethodInvocation |
---|
advisedMethod, arguments, marshalledArguments, methodHash, unadvisedMethod |
Fields inherited from class org.jboss.aop.joinpoint.InvocationBase |
---|
advisor, currentInterceptor, instanceResolver, interceptors, metadata, responseContextInfo, targetObject |
Constructor Summary | |
---|---|
MethodInvocationWrapper(MethodInvocation wrapped,
Interceptor[] interceptors)
|
Method Summary | |
---|---|
void |
addResponseAttachment(Object key,
Object val)
|
Invocation |
copy()
Copies complete state of Invocation object. |
Method |
getActualMethod()
|
Advisor |
getAdvisor()
|
Object[] |
getArguments()
Returns a non-null array containing all method arguments. |
MetaDataResolver |
getInstanceResolver()
|
SimpleMetaData |
getMetaData()
Return all the contextual data attached to this invocation |
Object |
getMetaData(Object group,
Object attr)
This method resolves metadata based on the context of the invocation. |
Method |
getMethod()
|
long |
getMethodHash()
|
Object |
getResponseAttachment(Object key)
|
Map<Object,Object> |
getResponseContextInfo()
|
Object |
getTargetObject()
|
Object |
invokeNext()
Invoke on the next interceptor in the chain. |
void |
setArguments(Object[] args)
Replaces method argument values by the ones contained in
arguments . |
void |
setMetaData(SimpleMetaData data)
Set all the contextual data attached to this invocation |
void |
setResponseContextInfo(Map<Object,Object> responseContextInfo)
|
void |
setTargetObject(Object targetObject)
|
Methods inherited from class org.jboss.aop.joinpoint.MethodInvocation |
---|
getWrapper, handleErrors, invokeTarget, readExternal, resolveAnnotation, resolveAnnotation, resolveTypedAnnotation, resolveTypedAnnotation, toString, writeExternal |
Methods inherited from class org.jboss.aop.joinpoint.InvocationBase |
---|
getCurrentInterceptor, getInterceptors, invokeNext, resolveClassAnnotation, resolveClassMetaData, resolveTypedClassAnnotation, setAdvisor, setInstanceResolver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MethodInvocationWrapper(MethodInvocation wrapped, Interceptor[] interceptors)
Method Detail |
---|
public Object getMetaData(Object group, Object attr)
MethodInvocation
getMetaData
in interface Invocation
getMetaData
in class MethodInvocation
public Object invokeNext() throws Throwable
MethodInvocation
invokeNext
in interface Invocation
invokeNext
in class MethodInvocation
Throwable
public MetaDataResolver getInstanceResolver()
getInstanceResolver
in class InvocationBase
public Object[] getArguments()
MethodInvocation
The returned array can be changed by the advice or interceptor accordingly. All
changes are reflected on joinpoint execution, and are noticed as well by
other advices and interceptors that are executed after the current one.
However, changes to this array are limited to the scope of current advice
execution, and must be performed before execution of MethodInvocation.invokeNext()
,
InvocationBase.invokeNext(Interceptor[])
, or MethodInvocation.invokeTarget()
method.
Otherwise, inconsistency on joinpoint argument values may be noticed.
getArguments
in class MethodInvocation
public void setArguments(Object[] args)
MethodInvocation
arguments
.
Advices and interceptors must be aware that, for performance reasons,
this array does not get copied across; its reference is directly used instead.
Hence, changes to arguments
array after this method being called
are forbidden. Otherwise, inconsistency on joinpoint argument values may be
noticed.
setArguments
in class MethodInvocation
args
- a non-null array containing the new values of method arguments.
The size of this array must be the same as the one of
MethodInvocation.getArguments()
, as well as the element types.public Object getTargetObject()
getTargetObject
in interface Invocation
getTargetObject
in class InvocationBase
public Invocation copy()
MethodInvocation
copy
in interface Invocation
copy
in class MethodInvocation
public Method getMethod()
getMethod
in class MethodInvocation
public Method getActualMethod()
getActualMethod
in class MethodInvocation
public long getMethodHash()
getMethodHash
in class MethodInvocation
public Advisor getAdvisor()
getAdvisor
in interface Invocation
getAdvisor
in class MethodInvocation
public Map<Object,Object> getResponseContextInfo()
getResponseContextInfo
in interface Invocation
getResponseContextInfo
in class InvocationBase
public void setResponseContextInfo(Map<Object,Object> responseContextInfo)
setResponseContextInfo
in interface Invocation
setResponseContextInfo
in class InvocationBase
public Object getResponseAttachment(Object key)
getResponseAttachment
in interface Invocation
getResponseAttachment
in class InvocationBase
public void addResponseAttachment(Object key, Object val)
addResponseAttachment
in interface Invocation
addResponseAttachment
in class InvocationBase
public SimpleMetaData getMetaData()
InvocationBase
getMetaData
in interface Invocation
getMetaData
in class InvocationBase
public void setMetaData(SimpleMetaData data)
InvocationBase
setMetaData
in interface Invocation
setMetaData
in class InvocationBase
public void setTargetObject(Object targetObject)
setTargetObject
in interface Invocation
setTargetObject
in class InvocationBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |