spring-framework / org.springframework.aop.aspectj.annotation / ReflectiveAspectJAdvisorFactory

ReflectiveAspectJAdvisorFactory

open class ReflectiveAspectJAdvisorFactory : AbstractAspectJAdvisorFactory, Serializable

Factory that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax, using reflection to invoke the corresponding advice methods.

Author
Rod Johnson

Author
Adrian Colyer

Author
Juergen Hoeller

Author
Ramnivas Laddad

Author
Phillip Webb

Since
2.0

Constructors

<init>

ReflectiveAspectJAdvisorFactory()

Create a new ReflectiveAspectJAdvisorFactory.

ReflectiveAspectJAdvisorFactory(beanFactory: BeanFactory)

Create a new ReflectiveAspectJAdvisorFactory, propagating the given BeanFactory to the created AspectJExpressionPointcut instances, for bean pointcut handling as well as consistent ClassLoader resolution.

Functions

getAdvice

open fun getAdvice(candidateAdviceMethod: Method, expressionPointcut: AspectJExpressionPointcut, aspectInstanceFactory: MetadataAwareAspectInstanceFactory, declarationOrder: Int, aspectName: String): Advice

getAdvisor

open fun getAdvisor(candidateAdviceMethod: Method, aspectInstanceFactory: MetadataAwareAspectInstanceFactory, declarationOrderInAspect: Int, aspectName: String): Advisor

getAdvisors

open fun getAdvisors(aspectInstanceFactory: MetadataAwareAspectInstanceFactory): MutableList<Advisor>

Inherited Functions

isAspect

open fun isAspect(clazz: Class<*>): Boolean

We consider something to be an AspectJ aspect suitable for use by the Spring AOP system if it has the @Aspect annotation, and was not compiled by ajc. The reason for this latter test is that aspects written in the code-style (AspectJ language) also have the annotation present when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.

validate

open fun validate(aspectClass: Class<*>): Unit