java.lang.Object | |
↳ | org.springframework.aop.framework.ReflectiveMethodInvocation |
Spring's implementation of the AOP Alliance
org.aopalliance.intercept.MethodInvocation interface,
implementing the extended
ProxyMethodInvocation
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 attach custom attributes to the invocation,
using the setUserAttribute(String, Object)
/ getUserAttribute(String)
methods.
NOTE: This class is considered internal and should not be
directly accessed. The sole reason for it being public is compatibility
with existing framework integrations (e.g. Pitchfork). For any other
purposes, use the ProxyMethodInvocation
interface instead.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
arguments | |||||||||||
interceptorsAndDynamicMethodMatchers | List of MethodInterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks. | ||||||||||
method | |||||||||||
proxy | |||||||||||
target |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a new ReflectiveMethodInvocation with the given arguments.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the method invoked on the proxied interface.
| |||||||||||
Return the proxy that this method invocation was made through.
| |||||||||||
Return the value of the specified user attribute.
| |||||||||||
Return user attributes associated with this invocation.
| |||||||||||
This implementation returns a shallow copy of this invocation object,
including an independent copy of the original arguments array.
| |||||||||||
This implementation returns a shallow copy of this invocation object,
using the given arguments array for the clone.
| |||||||||||
Set the arguments to be used on subsequent invocations in the any advice
in this chain.
| |||||||||||
Add the specified user attribute with the given value to this invocation.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoke the joinpoint using reflection.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.aop.ProxyMethodInvocation
|
List of MethodInterceptor and InterceptorAndDynamicMethodMatcher that need dynamic checks.
Construct a new ReflectiveMethodInvocation with the given arguments.
proxy | the proxy object that the invocation was made on |
---|---|
target | the target object to invoke |
method | the method to invoke |
arguments | the arguments to invoke the method with |
targetClass | the target class, for MethodMatcher invocations |
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. |
Return the method invoked on the proxied interface. May or may not correspond with a method invoked on an underlying implementation of that interface.
Return the proxy that this method invocation was made through.
Return the value of the specified user attribute.
key | the name of the attribute |
---|
null
if not setReturn user attributes associated with this invocation. This method provides an invocation-bound alternative to a ThreadLocal.
This map is initialized lazily and is not used in the AOP framework itself.
null
)
This implementation returns a shallow copy of this invocation object, including an independent copy of the original arguments array.
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.
proceed()
can be called once per clone.
This implementation returns a shallow copy of this invocation object, using the given arguments array for the clone.
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.
arguments | the arguments that the cloned invocation is supposed to use, overriding the original arguments |
---|
proceed()
can be called once per clone.
Set the arguments to be used on subsequent invocations in the any advice in this chain.
arguments | the argument array |
---|
Add the specified user attribute with the given value to this invocation.
Such attributes are not used within the AOP framework itself. They are just kept as part of the invocation object, for use in special interceptors.
key | the name of the attribute |
---|---|
value | the value of the attribute, or null to reset it
|
Invoke the joinpoint using reflection. Subclasses can override this to use custom invocation.
Throwable | if invoking the joinpoint resulted in an exception |
---|