The Spring Framework

org.springframework.aop.aspectj.annotation
Class InstantiationModelAwarePointcutAdvisorImpl

java.lang.Object
  extended by org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl
All Implemented Interfaces:
Advisor, AspectJPrecedenceInformation, InstantiationModelAwarePointcutAdvisor, PointcutAdvisor, Ordered

 class InstantiationModelAwarePointcutAdvisorImpl
extends Object
implements InstantiationModelAwarePointcutAdvisor, Ordered, AspectJPrecedenceInformation

Internal implementation of AspectJPointcutAdvisor Note that there will be one instance of this advisor for each target method.

Since:
2.0
Author:
Rod Johnson

Constructor Summary
InstantiationModelAwarePointcutAdvisorImpl(AspectJAdvisorFactory af, AspectJExpressionPointcut ajexp, MetadataAwareAspectInstanceFactory aif, Method method, int declarationOrderInAspect, String aspectName)
           
 
Method Summary
 org.aopalliance.aop.Advice getAdvice()
          Lazily instantiate advice if necessary
 MetadataAwareAspectInstanceFactory getAspectInstanceFactory()
           
 AspectMetadata getAspectMetadata()
           
 String getAspectName()
          The name of the aspect (bean) in which the advice was declared.
 int getDeclarationOrder()
          The declaration order of the advice member within the aspect
 AspectJExpressionPointcut getDeclaredPointcut()
           
 int getOrder()
          Return the order value of this object, with a higher value meaning greater in terms of sorting.
 Pointcut getPointcut()
          The pointcut for Spring AOP to use.
 boolean isAdviceInstantiated()
           
 boolean isAfterAdvice()
           
 boolean isBeforeAdvice()
           
 boolean isLazy()
           
 boolean isPerInstance()
          This is only of interest for Spring AOP: AspectJ instantiation semantics are much richer.
 void setOrder(int order)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstantiationModelAwarePointcutAdvisorImpl

public InstantiationModelAwarePointcutAdvisorImpl(AspectJAdvisorFactory af,
                                                  AspectJExpressionPointcut ajexp,
                                                  MetadataAwareAspectInstanceFactory aif,
                                                  Method method,
                                                  int declarationOrderInAspect,
                                                  String aspectName)
Method Detail

getPointcut

public Pointcut getPointcut()
The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change depending on the state of the advice.

Specified by:
getPointcut in interface PointcutAdvisor

isPerInstance

public boolean isPerInstance()
This is only of interest for Spring AOP: AspectJ instantiation semantics are much richer. In AspectJ terminology, all a return of true means here is that the aspect is not a SINGLETON.

Specified by:
isPerInstance in interface Advisor

getAspectMetadata

public AspectMetadata getAspectMetadata()

getAdvice

public org.aopalliance.aop.Advice getAdvice()
Lazily instantiate advice if necessary

Specified by:
getAdvice in interface Advisor
Returns:
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice

isLazy

public boolean isLazy()
Specified by:
isLazy in interface InstantiationModelAwarePointcutAdvisor

isAdviceInstantiated

public boolean isAdviceInstantiated()
Specified by:
isAdviceInstantiated in interface InstantiationModelAwarePointcutAdvisor

getAspectInstanceFactory

public MetadataAwareAspectInstanceFactory getAspectInstanceFactory()

getDeclaredPointcut

public AspectJExpressionPointcut getDeclaredPointcut()

toString

public String toString()
Overrides:
toString in class Object

setOrder

public void setOrder(int order)
Specified by:
setOrder in interface InstantiationModelAwarePointcutAdvisor

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0 or 1, with Ordered.LOWEST_PRECEDENCE indicating greatest. Same order values will result in arbitrary positions for the affected objects.

Higher value can be interpreted as lower priority, consequently the first object has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Note that order values below 0 are reserved for framework purposes. Application-specified values should always be 0 or greater, with only framework components (internal or third-party) supposed to use lower values.

Specified by:
getOrder in interface Ordered
Returns:
the order value
See Also:
Ordered.LOWEST_PRECEDENCE

getAspectName

public String getAspectName()
Description copied from interface: AspectJPrecedenceInformation
The name of the aspect (bean) in which the advice was declared.

Specified by:
getAspectName in interface AspectJPrecedenceInformation

getDeclarationOrder

public int getDeclarationOrder()
Description copied from interface: AspectJPrecedenceInformation
The declaration order of the advice member within the aspect

Specified by:
getDeclarationOrder in interface AspectJPrecedenceInformation

isBeforeAdvice

public boolean isBeforeAdvice()
Specified by:
isBeforeAdvice in interface AspectJPrecedenceInformation

isAfterAdvice

public boolean isAfterAdvice()
Specified by:
isAfterAdvice in interface AspectJPrecedenceInformation

The Spring Framework

Copyright © 2002-2006 The Spring Framework.