|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.aop.framework.ReflectiveMethodInvocation
public class ReflectiveMethodInvocation
Spring's implementation of AOP Alliance MethodInvocation interface.
Invokes the target object using reflection. Subclasses can override the invokeJoinpoint() method to change this behavior, so this is also a useful base class for more specialized MethodInvocation implementations.
It is possible to clone an invocation, to invoke proceed repeatedly
(once per clone), using the invocableClone method. It is also possible to
add custom attributes to the invocation (since 1.2.6) using the
getUserAttributes() method.
invokeJoinpoint(),
proceed(),
invocableClone()| Field Summary | |
|---|---|
protected Object[] |
arguments
|
protected List |
interceptorsAndDynamicMethodMatchers
List of MethodInterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks. |
protected Method |
method
|
protected Object |
proxy
|
protected Object |
target
|
| Constructor Summary | |
|---|---|
ReflectiveMethodInvocation(Object proxy,
Object target,
Method method,
Object[] arguments,
Class targetClass,
List interceptorsAndDynamicMethodMatchers)
Construct a new MethodInvocation with given arguments |
|
| Method Summary | |
|---|---|
Object[] |
getArguments()
|
Method |
getMethod()
Return the method invoked on the proxied interface. |
Object |
getProxy()
Return the proxy that this interception was made through. |
AccessibleObject |
getStaticPart()
|
Object |
getThis()
|
Map |
getUserAttributes()
Return user attributes associated with this invocation. |
MethodInvocation |
invocableClone()
Create a clone of this object. |
protected Object |
invokeJoinpoint()
Invoke the joinpoint using reflection. |
Object |
proceed()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Object proxy
protected final Object target
protected final Method method
protected Object[] arguments
protected final List interceptorsAndDynamicMethodMatchers
| Constructor Detail |
|---|
public ReflectiveMethodInvocation(Object proxy,
Object target,
Method method,
Object[] arguments,
Class targetClass,
List interceptorsAndDynamicMethodMatchers)
interceptorsAndDynamicMethodMatchers - interceptors that should be applied,
along with any InterceptorAndDynamicMethodMatchers that need evaluation at runtime.
MethodMatchers included in this struct must already have been found to have matched
as far as was possibly statically. Passing an array might be about 10% faster,
but would complicate the code. And it would work only for static pointcuts.| Method Detail |
|---|
public final Object getProxy()
getProxy in interface ProxyMethodInvocationpublic final Object getThis()
getThis in interface Joinpointpublic final AccessibleObject getStaticPart()
getStaticPart in interface Joinpointpublic final Method getMethod()
getMethod in interface MethodInvocationpublic final Object[] getArguments()
getArguments in interface Invocationpublic Map getUserAttributes()
null)
public Object proceed()
throws Throwable
proceed in interface JoinpointThrowable
protected Object invokeJoinpoint()
throws Throwable
Throwable - if invoking the joinpoint resulted in an exceptionpublic MethodInvocation invocableClone()
proceed()
is invoked on this object, proceed() can be invoked once per clone
to invoke the joinpoint (and the rest of the advice chain) more than once.
This method returns a shallow copy, except for the argument array, which is deep-copied to allow for independent modification. We want a shallow copy in this case: We want to use the same interceptor-chain and other object references, but we want an independent value for the current interceptor index.
Object.clone()public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||