类 AspectJAfterReturningAdvice
java.lang.Object
infra.aop.aspectj.AbstractAspectJAdvice
infra.aop.aspectj.AspectJAfterReturningAdvice
- 所有已实现的接口:
AfterAdvice,AfterReturningAdvice,AspectJPrecedenceInformation,infra.core.Ordered,Serializable,Advice
public class AspectJAfterReturningAdvice
extends AbstractAspectJAdvice
implements AfterReturningAdvice, AfterAdvice, Serializable
Framework AOP advice wrapping an AspectJ after-returning advice method.
- 从以下版本开始:
- 4.0
- 作者:
- Rod Johnson, Juergen Hoeller, Ramnivas Laddad
- 另请参阅:
-
字段概要
从类继承的字段 infra.aop.aspectj.AbstractAspectJAdvice
aspectJAdviceMethod, JOIN_POINT_KEY从接口继承的字段 infra.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器构造器说明AspectJAfterReturningAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif) -
方法概要
修饰符和类型方法说明voidafterReturning(Object returnValue, MethodInvocation invocation) Callback after a given method successfully returned.booleanReturn whether this is an after advice.booleanReturn whether this is a before advice.private booleanmatchesReturnValue(Class<?> type, Method method, Object returnValue) Following AspectJ semantics, if a return value is null (or return type is void), then the return type of target method should be used to determine whether advice is invoked or not.voidsetReturningName(String name) private booleanshouldInvokeOnReturnValueOf(Method method, Object returnValue) Following AspectJ semantics, if a returning clause was specified, then the advice is only invoked if the returned value is an instance of the given returning type and generic type parameters, if any, match the assignment rules.从类继承的方法 infra.aop.aspectj.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, setReturningNameNoCheck, setThrowingName, setThrowingNameNoCheck, supportsProceedingJoinPoint, toString
-
构造器详细资料
-
AspectJAfterReturningAdvice
public AspectJAfterReturningAdvice(Method aspectJBeforeAdviceMethod, AspectJExpressionPointcut pointcut, AspectInstanceFactory aif)
-
-
方法详细资料
-
isBeforeAdvice
public boolean isBeforeAdvice()从接口复制的说明:AspectJPrecedenceInformationReturn whether this is a before advice.- 指定者:
isBeforeAdvice在接口中AspectJPrecedenceInformation
-
isAfterAdvice
public boolean isAfterAdvice()从接口复制的说明:AspectJPrecedenceInformationReturn whether this is an after advice.- 指定者:
isAfterAdvice在接口中AspectJPrecedenceInformation
-
setReturningName
-
afterReturning
从接口复制的说明:AfterReturningAdviceCallback after a given method successfully returned.- 指定者:
afterReturning在接口中AfterReturningAdvice- 参数:
returnValue- the value returned by the method, if anyinvocation- the method invocation join-point- 抛出:
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.
-
shouldInvokeOnReturnValueOf
Following AspectJ semantics, if a returning clause was specified, then the advice is only invoked if the returned value is an instance of the given returning type and generic type parameters, if any, match the assignment rules. If the returning type is Object, the advice is *always* invoked.- 参数:
returnValue- the return value of the target method- 返回:
- whether to invoke the advice method for the given return value
-
matchesReturnValue
Following AspectJ semantics, if a return value is null (or return type is void), then the return type of target method should be used to determine whether advice is invoked or not. Also, even if the return type is void, if the type of argument declared in the advice method is Object, then the advice must still get invoked.- 参数:
type- the type of argument declared in advice methodmethod- the advice methodreturnValue- the return value of the target method- 返回:
- whether to invoke the advice method for the given return value and type
-