java.lang.Object | |
↳ | org.springframework.aop.aspectj.AbstractAspectJAdvice |
Known Direct Subclasses |
Base class for AOP Alliance org.aopalliance.aop.Advice classes wrapping an AspectJ aspect or an AspectJ-annotated advice method.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.core.Ordered
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
JOIN_POINT_KEY | Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint. | ||||||||||
aspectJAdviceMethod |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new AbstractAspectJAdvice for the given advice method.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build a 'safe' pointcut that excludes the AspectJ advice method itself.
| |||||||||||
Do as much work as we can as part of the set-up so that argument binding
on subsequent advice invocations can be as fast as possible.
| |||||||||||
Lazily instantiate joinpoint for the current invocation.
| |||||||||||
Return the ClassLoader for aspect instances.
| |||||||||||
Return the factory for aspect instances.
| |||||||||||
Return the AspectJ-style advice method.
| |||||||||||
The name of the aspect (bean) in which the advice was declared.
| |||||||||||
The declaration order of the advice member within the aspect.
| |||||||||||
Return the order value of this object, with a
higher value meaning greater in terms of sorting.
| |||||||||||
Return the AspectJ expression pointcut.
| |||||||||||
Set by creator of this advice object if the argument names are known.
| |||||||||||
Sets the declaration order of this advice within the aspect
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Take the arguments at the method execution join point and output a set of arguments
to the advice method
| |||||||||||
Create a ParameterNameDiscoverer to be used for argument binding.
| |||||||||||
Overridden in around advice to return proceeding join point.
| |||||||||||
Get the current join point match at the join point we are being dispatched on.
| |||||||||||
Invoke the advice method.
| |||||||||||
We need to hold the returning name at this level for argument binding calculations,
this method allows the afterReturning advice subclass to set the name.
| |||||||||||
We need to hold the throwing name at this level for argument binding calculations,
this method allows the afterThrowing advice subclass to set the name.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.aop.aspectj.AspectJPrecedenceInformation
| |||||||||||
From interface
org.springframework.core.Ordered
|
Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint.
Create a new AbstractAspectJAdvice for the given advice method.
aspectJAdviceMethod | the AspectJ-style advice method |
---|---|
pointcut | the AspectJ expression pointcut |
aspectInstanceFactory | the factory for aspect instances |
Build a 'safe' pointcut that excludes the AspectJ advice method itself.
Do as much work as we can as part of the set-up so that argument binding on subsequent advice invocations can be as fast as possible.
If the first argument is of type JoinPoint or ProceedingJoinPoint then we pass a JoinPoint in that position (ProceedingJoinPoint for around advice).
If the first argument is of type JoinPoint.StaticPart
then we pass a JoinPoint.StaticPart
in that position.
Remaining arguments have to be bound by pointcut evaluation at a given join point. We will get back a map from argument name to value. We need to calculate which advice parameter needs to be bound to which argument name. There are multiple strategies for determining this binding, which are arranged in a ChainOfResponsibility.
Lazily instantiate joinpoint for the current invocation. Requires MethodInvocation to be bound with ExposeInvocationInterceptor.
Do not use if access is available to the current ReflectiveMethodInvocation (in an around advice).
Return the factory for aspect instances.
The declaration order of the advice member within the aspect.
Return the order value of this object, with a higher value meaning greater in terms of sorting.
Normally starting with 0, with Integer.MAX_VALUE
indicating the greatest value. Same order values will result
in arbitrary positions for the affected objects.
Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).
Set by creator of this advice object if the argument names are known.
This could be for example because they have been explicitly specified in XML, or in an advice annotation.
argNames | comma delimited list of arg names |
---|
Sets the declaration order of this advice within the aspect
Take the arguments at the method execution join point and output a set of arguments to the advice method
jp | the current JoinPoint |
---|---|
jpMatch | the join point match that matched this execution join point |
returnValue | the return value from the method execution (may be null) |
ex | the exception thrown by the method execution (may be null) |
Create a ParameterNameDiscoverer to be used for argument binding.
The default implementation creates a PrioritizedParameterNameDiscoverer
containing a LocalVariableTableParameterNameDiscoverer
and an
AspectJAdviceParameterNameDiscoverer
.
Overridden in around advice to return proceeding join point.
Get the current join point match at the join point we are being dispatched on.
Invoke the advice method.
jpMatch | the JoinPointMatch that matched this execution join point |
---|---|
returnValue | the return value from the method execution (may be null) |
ex | the exception thrown by the method execution (may be null) |
Throwable | in case of invocation failure |
---|
Throwable |
---|
We need to hold the returning name at this level for argument binding calculations, this method allows the afterReturning advice subclass to set the name.
We need to hold the throwing name at this level for argument binding calculations, this method allows the afterThrowing advice subclass to set the name.