Class AspectJAroundAdvice
java.lang.Object
org.springframework.aop.aspectj.AbstractAspectJAdvice
org.springframework.aop.aspectj.AspectJAroundAdvice
- All Implemented Interfaces:
Serializable, Advice, Interceptor, MethodInterceptor, AspectJPrecedenceInformation, Ordered
public class AspectJAroundAdvice
extends AbstractAspectJAdvice
implements MethodInterceptor, Serializable
Spring AOP around advice (MethodInterceptor) that wraps
an AspectJ advice method. Exposes ProceedingJoinPoint.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
-
Field Summary
Fields inherited from class AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEYFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAspectJAroundAdvice(Method aspectJAroundAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif) -
Method Summary
Modifier and TypeMethodDescriptionImplement this method to perform extra treatments before and after the invocation.booleanReturn whether this is an after advice.booleanReturn whether this is a before advice.protected org.aspectj.lang.ProceedingJoinPointReturn the ProceedingJoinPoint for the current invocation, instantiating it lazily if it hasn't been bound to the thread already.protected booleanMethods inherited from class AbstractAspectJAdvice
argBinding, buildSafePointcut, calculateArgumentBindings, createParameterNameDiscoverer, currentJoinPoint, getAspectClassLoader, getAspectInstanceFactory, getAspectJAdviceMethod, getAspectName, getDeclarationOrder, getDiscoveredReturningGenericType, getDiscoveredReturningType, getDiscoveredThrowingType, getJoinPoint, getJoinPointMatch, getJoinPointMatch, getOrder, getPointcut, invokeAdviceMethod, invokeAdviceMethod, invokeAdviceMethodWithGivenArgs, setArgumentNames, setArgumentNamesFromStringArray, setAspectName, setDeclarationOrder, setReturningName, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, toString
-
Constructor Details
-
AspectJAroundAdvice
public AspectJAroundAdvice(Method aspectJAroundAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
-
-
Method Details
-
isBeforeAdvice
public boolean isBeforeAdvice()Description copied from interface:AspectJPrecedenceInformationReturn whether this is a before advice.- Specified by:
isBeforeAdvicein interfaceAspectJPrecedenceInformation
-
isAfterAdvice
public boolean isAfterAdvice()Description copied from interface:AspectJPrecedenceInformationReturn whether this is an after advice.- Specified by:
isAfterAdvicein interfaceAspectJPrecedenceInformation
-
supportsProceedingJoinPoint
protected boolean supportsProceedingJoinPoint()- Overrides:
supportsProceedingJoinPointin classAbstractAspectJAdvice
-
invoke
Description copied from interface:MethodInterceptorImplement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed().- Specified by:
invokein interfaceMethodInterceptor- Parameters:
mi- the method invocation joinpoint- Returns:
- the result of the call to
Joinpoint.proceed(); might be intercepted by the interceptor - Throws:
Throwable- if the interceptors or the target object throws an exception
-
lazyGetProceedingJoinPoint
protected org.aspectj.lang.ProceedingJoinPoint lazyGetProceedingJoinPoint(ProxyMethodInvocation rmi) Return the ProceedingJoinPoint for the current invocation, instantiating it lazily if it hasn't been bound to the thread already.- Parameters:
rmi- the current Spring AOP ReflectiveMethodInvocation, which we'll use for attribute binding- Returns:
- the ProceedingJoinPoint to make available to advice methods
-