public class MethodInvocation extends InvocationBase implements Externalizable
| Modifier and Type | Field and Description |
|---|---|
protected Method |
advisedMethod |
protected Object[] |
arguments
arguments of the method call expressed as an array of objects
|
protected MarshalledObject |
marshalledArguments |
protected long |
methodHash |
protected Method |
unadvisedMethod |
advisor, currentInterceptor, instanceResolver, interceptors, metadata, responseContextInfo, targetObject| Modifier | Constructor and Description |
|---|---|
|
MethodInvocation() |
protected |
MethodInvocation(Interceptor[] interceptors) |
|
MethodInvocation(Interceptor[] interceptors,
long methodHash,
Method advisedMethod,
Method unadvisedMethod,
Advisor advisor) |
|
MethodInvocation(MethodInfo info,
Interceptor[] interceptors) |
| Modifier and Type | Method and Description |
|---|---|
Invocation |
copy()
Copies complete state of Invocation object.
|
Method |
getActualMethod() |
Advisor |
getAdvisor() |
Object[] |
getArguments()
Returns a non-null array containing all method arguments.
|
Object |
getMetaData(Object group,
Object attr)
This method resolves metadata based on the context of the invocation.
|
Method |
getMethod() |
long |
getMethodHash() |
Invocation |
getWrapper(Interceptor[] newchain)
Returns a wrapper invocation object that can insert a new chain of interceptors
at runtime to the invocation flow.
|
static Throwable |
handleErrors(Object target,
Method method,
Object[] arguments,
Throwable t)
Handle invocation errors
|
Object |
invokeNext()
Invoke on the next interceptor in the chain.
|
Object |
invokeTarget()
Invokes the target joinpoint for this invocation skipping any subsequent
interceptors in the chain.
|
void |
readExternal(ObjectInput in) |
Object |
resolveAnnotation(Class<? extends Annotation> annotation)
This method resolves an annotation based on the context of the invocation.
|
Object |
resolveAnnotation(Class<? extends Annotation>[] annotations)
This method resolves an annotation based on the context of the invocation.
|
<T extends Annotation> |
resolveTypedAnnotation(Class<T> annotation)
Abstraction for resolving an annotation so that
it can be overriden from the Method, Constructor, Field, etc.
|
<T extends Annotation> |
resolveTypedAnnotation(Class<T>[] annotations)
Abstraction for resolving an annotation so that
it can be overriden from the Method, Constructor, Field, etc.
|
void |
setArguments(Object[] arguments)
Replaces method argument values by the ones contained in
arguments. |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
addResponseAttachment, getCurrentInterceptor, getInstanceResolver, getInterceptors, getMetaData, getResponseAttachment, getResponseContextInfo, getTargetObject, invokeNext, resolveClassAnnotation, resolveClassMetaData, resolveTypedClassAnnotation, setAdvisor, setInstanceResolver, setMetaData, setResponseContextInfo, setTargetObjectprotected Object[] arguments
protected long methodHash
protected MarshalledObject marshalledArguments
protected Method advisedMethod
protected Method unadvisedMethod
public MethodInvocation(MethodInfo info, Interceptor[] interceptors)
public MethodInvocation(Interceptor[] interceptors, long methodHash, Method advisedMethod, Method unadvisedMethod, Advisor advisor)
protected MethodInvocation(Interceptor[] interceptors)
public MethodInvocation()
public Object invokeNext() throws Throwable
invokeNext in interface InvocationinvokeNext in class InvocationBaseThrowablepublic Object invokeTarget() throws Throwable
invokeTarget in interface InvocationinvokeTarget in class InvocationBaseThrowablepublic static Throwable handleErrors(Object target, Method method, Object[] arguments, Throwable t) throws Throwable
target - the targetmethod - the methodarguments - the argumentst - the errorThrowable - the throwablepublic Object resolveAnnotation(Class<? extends Annotation> annotation)
resolveAnnotation in interface InvocationresolveAnnotation in class InvocationBasepublic <T extends Annotation> T resolveTypedAnnotation(Class<T> annotation)
InvocationresolveTypedAnnotation in interface InvocationresolveTypedAnnotation in class InvocationBasepublic Object resolveAnnotation(Class<? extends Annotation>[] annotations)
resolveAnnotation in interface InvocationresolveAnnotation in class InvocationBasepublic <T extends Annotation> T resolveTypedAnnotation(Class<T>[] annotations)
InvocationresolveTypedAnnotation in interface InvocationresolveTypedAnnotation in class InvocationBasepublic Object getMetaData(Object group, Object attr)
getMetaData in interface InvocationgetMetaData in class InvocationBasepublic Invocation getWrapper(Interceptor[] newchain)
getWrapper in interface Invocationnewchain - chain of interceptors to be inserted on invocationpublic Invocation copy()
copy in interface Invocationpublic Object[] getArguments()
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 invokeNext(),
InvocationBase.invokeNext(Interceptor[]), or invokeTarget() method.
Otherwise, inconsistency on joinpoint argument values may be noticed.
public void setArguments(Object[] arguments)
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.
arguments - a non-null array containing the new values of method arguments.
The size of this array must be the same as the one of
getArguments(), as well as the element types.public Method getMethod()
public Method getActualMethod()
public long getMethodHash()
public Advisor getAdvisor()
getAdvisor in interface InvocationgetAdvisor in class InvocationBasepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.