Save This Page
Home » Spring-Framework-090522 » org.springframework » aop » aspectj » [javadoc | source]
abstract public class: AbstractAspectJAdvice [javadoc | source]

All Implemented Interfaces:
    org.aopalliance.aop.Advice, AspectJPrecedenceInformation

Direct Known Subclasses:
    AspectJMethodBeforeAdvice, AspectJAfterReturningAdvice, AspectJAfterThrowingAdvice, AspectJAfterAdvice, AspectJAroundAdvice

Base class for AOP Alliance org.aopalliance.aop.Advice classes wrapping an AspectJ aspect or an AspectJ-annotated advice method.
Field Summary
protected static final  String JOIN_POINT_KEY    Key used in ReflectiveMethodInvocation userAtributes map for the current joinpoint. 
protected final  Method aspectJAdviceMethod     
 public AbstractAspectJAdvice(Method aspectJAdviceMethod,
    AspectJExpressionPointcut pointcut,
    AspectInstanceFactory aspectInstanceFactory) 
    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
Method from org.springframework.aop.aspectj.AbstractAspectJAdvice Summary:
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
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.aop.aspectj.AbstractAspectJAdvice Detail:
 protected Object[] argBinding(JoinPoint jp,
    JoinPointMatch jpMatch,
    Object returnValue,
    Throwable ex) 
    Take the arguments at the method execution join point and output a set of arguments to the advice method
 public final Pointcut buildSafePointcut() 
    Build a 'safe' pointcut that excludes the AspectJ advice method itself.
 public final synchronized  void calculateArgumentBindings() 
    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.

 protected ParameterNameDiscoverer createParameterNameDiscoverer() 
 public static JoinPoint currentJoinPoint() 
    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).

 public final ClassLoader getAspectClassLoader() 
    Return the ClassLoader for aspect instances.
 public final AspectInstanceFactory getAspectInstanceFactory() 
    Return the factory for aspect instances.
 public final Method getAspectJAdviceMethod() 
    Return the AspectJ-style advice method.
 public String getAspectName() 
 public int getDeclarationOrder() 
 protected Object getDiscoveredReturningGenericType() 
 protected Class getDiscoveredReturningType() 
 protected Class getDiscoveredThrowingType() 
 protected JoinPoint getJoinPoint() 
    Overridden in around advice to return proceeding join point.
 protected JoinPointMatch getJoinPointMatch() 
    Get the current join point match at the join point we are being dispatched on.
 protected JoinPointMatch getJoinPointMatch(ProxyMethodInvocation pmi) 
 public int getOrder() 
 public final AspectJExpressionPointcut getPointcut() 
    Return the AspectJ expression pointcut.
 protected Object invokeAdviceMethod(JoinPointMatch jpMatch,
    Object returnValue,
    Throwable ex) throws Throwable 
    Invoke the advice method.
 protected Object invokeAdviceMethod(JoinPoint jp,
    JoinPointMatch jpMatch,
    Object returnValue,
    Throwable t) throws Throwable 
 protected Object invokeAdviceMethodWithGivenArgs(Object[] args) throws Throwable 
 public  void setArgumentNames(String argNames) 
    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.

 public  void setArgumentNamesFromStringArray(String[] args) 
 public  void setAspectName(String name) 
 public  void setDeclarationOrder(int order) 
    Sets the declaration order of this advice within the aspect
 public  void setReturningName(String name) 
 protected  void setReturningNameNoCheck(String name) 
    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.
 public  void setThrowingName(String name) 
 protected  void setThrowingNameNoCheck(String 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.
 protected boolean supportsProceedingJoinPoint() 
 public String toString()