public class AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorAutoProxyCreator
AspectJAwareAdvisorAutoProxyCreator
subclass that processes all AspectJ
annotation aspects in the current application context, as well as Spring Advisors.
Any AspectJ annotated classes will automatically be recognized, and their advice applied if Spring AOP's proxy-based model is capable of applying it. This covers method execution joinpoints.
If the <aop:include> element is used, only @AspectJ beans with names matched by an include pattern will be considered as defining aspects to use for Spring auto-proxying.
Processing of Spring Advisors follows the rules established in
AbstractAdvisorAutoProxyCreator
.
AspectJAdvisorFactory
,
Serialized FormDO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
AnnotationAwareAspectJAutoProxyCreator() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<Advisor> |
findCandidateAdvisors()
Find all candidate Advisors to use in auto-proxying.
|
protected void |
initBeanFactory(ConfigurableListableBeanFactory beanFactory) |
protected boolean |
isEligibleAspectBean(java.lang.String beanName)
Check whether the given aspect bean is eligible for auto-proxying.
|
protected boolean |
isInfrastructureClass(java.lang.Class<?> beanClass)
Return whether the given bean class represents an infrastructure class
that should never be proxied.
|
void |
setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory) |
void |
setIncludePatterns(java.util.List<java.lang.String> patterns)
Set a list of regex patterns, matching eligible @AspectJ bean names.
|
extendAdvisors, shouldSkip, sortAdvisors
advisorsPreFiltered, findAdvisorsThatCanApply, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, isEligibleAdvisorBean, setBeanFactory
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, isFrozen, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessProperties, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, shouldProxyTargetClass, wrapIfNecessary
evaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoader
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
postProcessPropertyValues
public AnnotationAwareAspectJAutoProxyCreator()
public void setIncludePatterns(java.util.List<java.lang.String> patterns)
Default is to consider all @AspectJ beans as eligible.
public void setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)
protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory)
initBeanFactory
in class AbstractAdvisorAutoProxyCreator
protected java.util.List<Advisor> findCandidateAdvisors()
AbstractAdvisorAutoProxyCreator
findCandidateAdvisors
in class AbstractAdvisorAutoProxyCreator
protected boolean isInfrastructureClass(java.lang.Class<?> beanClass)
AbstractAutoProxyCreator
The default implementation considers Advices, Advisors and AopInfrastructureBeans as infrastructure classes.
isInfrastructureClass
in class AbstractAutoProxyCreator
beanClass
- the class of the beanAdvice
,
Advisor
,
AopInfrastructureBean
,
AbstractAutoProxyCreator.shouldSkip(java.lang.Class<?>, java.lang.String)
protected boolean isEligibleAspectBean(java.lang.String beanName)
If no <aop:include> elements were used then "includePatterns" will be
null
and all beans are included. If "includePatterns" is non-null,
then one of the patterns must match.