Class AspectJMethodBeforeAdvice
java.lang.Object
org.springframework.aop.aspectj.AbstractAspectJAdvice
org.springframework.aop.aspectj.AspectJMethodBeforeAdvice
- All Implemented Interfaces:
Serializable, Advice, AspectJPrecedenceInformation, BeforeAdvice, MethodBeforeAdvice, Ordered
public class AspectJMethodBeforeAdvice
extends AbstractAspectJAdvice
implements MethodBeforeAdvice, Serializable
Spring AOP advice that wraps an AspectJ before method.
- Since:
- 2.0
- Author:
- Rod Johnson, Adrian Colyer
- See Also:
-
Field Summary
Fields inherited from class AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEYFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAspectJMethodBeforeAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif) -
Method Summary
Modifier and TypeMethodDescriptionvoidCallback before a given method is invoked.booleanReturn whether this is an after advice.booleanReturn whether this is a before advice.Methods 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, supportsProceedingJoinPoint, toString
-
Constructor Details
-
AspectJMethodBeforeAdvice
public AspectJMethodBeforeAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
-
-
Method Details
-
before
public void before(Method method, @Nullable Object[] args, @Nullable Object target) throws Throwable Description copied from interface:MethodBeforeAdviceCallback before a given method is invoked.- Specified by:
beforein interfaceMethodBeforeAdvice- Parameters:
method- the method being invokedargs- the arguments to the methodtarget- the target of the method invocation. May benull.- Throws:
Throwable- if this object wishes to abort the call. Any exception thrown will be returned to the caller if it's allowed by the method signature. Otherwise the exception will be wrapped as a runtime exception.
-
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
-