public interface AspectJAdvisorFactory
AspectMetadata
,
AjTypeSystem
Modifier and Type | Method and Description |
---|---|
Advice |
getAdvice(Method candidateAdviceMethod,
AspectJExpressionPointcut expressionPointcut,
MetadataAwareAspectInstanceFactory aspectInstanceFactory,
int declarationOrder,
String aspectName)
Build a Spring AOP Advice for the given AspectJ advice method.
|
Advisor |
getAdvisor(Method candidateAdviceMethod,
MetadataAwareAspectInstanceFactory aspectInstanceFactory,
int declarationOrder,
String aspectName)
Build a Spring AOP Advisor for the given AspectJ advice method.
|
List<Advisor> |
getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory)
Build Spring AOP Advisors for all annotated At-AspectJ methods
on the specified aspect instance.
|
boolean |
isAspect(Class<?> clazz)
Determine whether the given class is an aspect, as reported
by AspectJ's
AjTypeSystem . |
void |
validate(Class<?> aspectClass)
Is the given class a valid AspectJ aspect class?
|
boolean isAspect(Class<?> clazz)
AjTypeSystem
.
Will simply return false
if the supposed aspect is
invalid (such as an extension of a concrete aspect class).
Will return true for some aspects that Spring AOP cannot process,
such as those with unsupported instantiation models.
Use the validate(java.lang.Class<?>)
method to handle these cases if necessary.
clazz
- the supposed annotation-style AspectJ classvoid validate(Class<?> aspectClass) throws AopConfigException
aspectClass
- the supposed AspectJ annotation-style class to validateAopConfigException
- if the class is an invalid aspect
(which can never be legal)NotAnAtAspectException
- if the class is not an aspect at all
(which may or may not be legal, depending on the context)List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory)
aspectInstanceFactory
- the aspect instance factory
(not the aspect instance itself in order to avoid eager instantiation)@Nullable Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aspectInstanceFactory, int declarationOrder, String aspectName)
candidateAdviceMethod
- the candidate advice methodaspectInstanceFactory
- 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 right@Nullable Advice getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut expressionPointcut, MetadataAwareAspectInstanceFactory aspectInstanceFactory, int declarationOrder, String aspectName)
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