public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor
Synthetic advisor that instantiates the aspect.
|
AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends java.lang.annotation.Annotation>, AbstractAspectJAdvisorFactory.AspectJAnnotationType
Modifier and Type | Field and Description |
---|---|
private static java.util.Comparator<java.lang.reflect.Method> |
METHOD_COMPARATOR |
logger, parameterNameDiscoverer
Constructor and Description |
---|
ReflectiveAspectJAdvisorFactory() |
Modifier and Type | Method and Description |
---|---|
Advice |
getAdvice(java.lang.reflect.Method candidateAdviceMethod,
AspectJExpressionPointcut expressionPointcut,
MetadataAwareAspectInstanceFactory aspectInstanceFactory,
int declarationOrder,
java.lang.String aspectName)
Build a Spring AOP Advice for the given AspectJ advice method.
|
Advisor |
getAdvisor(java.lang.reflect.Method candidateAdviceMethod,
MetadataAwareAspectInstanceFactory aspectInstanceFactory,
int declarationOrderInAspect,
java.lang.String aspectName)
Build a Spring AOP Advisor for the given AspectJ advice method.
|
private java.util.List<java.lang.reflect.Method> |
getAdvisorMethods(java.lang.Class<?> aspectClass) |
java.util.List<Advisor> |
getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory)
Build Spring AOP Advisors for all annotated At-AspectJ methods
on the specified aspect instance.
|
private Advisor |
getDeclareParentsAdvisor(java.lang.reflect.Field introductionField)
Build a
DeclareParentsAdvisor
for the given introduction field. |
private AspectJExpressionPointcut |
getPointcut(java.lang.reflect.Method candidateAdviceMethod,
java.lang.Class<?> candidateAspectClass) |
createPointcutExpression, findAspectJAnnotationOnMethod, isAspect, validate
private static final java.util.Comparator<java.lang.reflect.Method> METHOD_COMPARATOR
public java.util.List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory)
AspectJAdvisorFactory
aspectInstanceFactory
- the aspect instance factory
(not the aspect instance itself in order to avoid eager instantiation)private java.util.List<java.lang.reflect.Method> getAdvisorMethods(java.lang.Class<?> aspectClass)
private Advisor getDeclareParentsAdvisor(java.lang.reflect.Field introductionField)
DeclareParentsAdvisor
for the given introduction field.
Resulting Advisors will need to be evaluated for targets.
introductionField
- the field to introspectnull
if not an Advisorpublic Advisor getAdvisor(java.lang.reflect.Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aspectInstanceFactory, int declarationOrderInAspect, java.lang.String aspectName)
AspectJAdvisorFactory
candidateAdviceMethod
- the candidate advice methodaspectInstanceFactory
- the aspect instance factorydeclarationOrderInAspect
- the declaration order within the aspectaspectName
- the name of the aspectnull
if the method is not an AspectJ advice method
or if it is a pointcut that will be used by other advice but will not
create a Spring advice in its own rightprivate AspectJExpressionPointcut getPointcut(java.lang.reflect.Method candidateAdviceMethod, java.lang.Class<?> candidateAspectClass)
public Advice getAdvice(java.lang.reflect.Method candidateAdviceMethod, AspectJExpressionPointcut expressionPointcut, MetadataAwareAspectInstanceFactory aspectInstanceFactory, int declarationOrder, java.lang.String aspectName)
AspectJAdvisorFactory
candidateAdviceMethod
- the candidate advice methodexpressionPointcut
- the AspectJ expression pointcutaspectInstanceFactory
- the aspect instance factorydeclarationOrder
- the declaration order within the aspectaspectName
- the name of the aspectnull
if the method is not an AspectJ advice method
or if it is a pointcut that will be used by other advice but will not
create a Spring advice in its own rightAspectJAroundAdvice
,
AspectJMethodBeforeAdvice
,
AspectJAfterAdvice
,
AspectJAfterReturningAdvice
,
AspectJAfterThrowingAdvice