public class

AnnotationAwareAspectJAutoProxyCreator

extends AspectJAwareAdvisorAutoProxyCreator
java.lang.Object
   ↳ org.springframework.aop.framework.ProxyConfig
     ↳ org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
       ↳ org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
         ↳ org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
           ↳ org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
[Expand]
Inherited Fields
From class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
Public Constructors
AnnotationAwareAspectJAutoProxyCreator()
Public Methods
void setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)
void setIncludePatterns(List<String> patterns)
Set a list of regex patterns, matching eligible @AspectJ bean names.
Protected Methods
List<Advisor> findCandidateAdvisors()
Find all candidate Advisors to use in auto-proxying.
void initBeanFactory(ConfigurableListableBeanFactory beanFactory)
boolean isEligibleAspectBean(String beanName)
Check whether the given aspect bean is eligible for auto-proxying.
boolean isInfrastructureClass(Class beanClass)
Return whether the given bean class represents an infrastructure class that should never be proxied.
[Expand]
Inherited Methods
From class org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
From class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
From class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
From class org.springframework.aop.framework.ProxyConfig
From class java.lang.Object
From interface org.springframework.beans.factory.BeanClassLoaderAware
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.beans.factory.config.BeanPostProcessor
From interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
From interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
From interface org.springframework.core.Ordered

Public Constructors

public AnnotationAwareAspectJAutoProxyCreator ()

Public Methods

public void setAspectJAdvisorFactory (AspectJAdvisorFactory aspectJAdvisorFactory)

public void setIncludePatterns (List<String> patterns)

Set a list of regex patterns, matching eligible @AspectJ bean names.

Default is to consider all @AspectJ beans as eligible.

Protected Methods

protected List<Advisor> findCandidateAdvisors ()

Find all candidate Advisors to use in auto-proxying.

Returns
  • the List of candidate Advisors

protected void initBeanFactory (ConfigurableListableBeanFactory beanFactory)

protected boolean isEligibleAspectBean (String beanName)

Check whether the given aspect bean is eligible for auto-proxying.

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.

protected boolean isInfrastructureClass (Class beanClass)

Return whether the given bean class represents an infrastructure class that should never be proxied.

Default implementation considers Advisors, Advices and AbstractAutoProxyCreators as infrastructure classes.

Parameters
beanClass the class of the bean
Returns
  • whether the bean represents an infrastructure class