Class AnnotationAwareAspectJAutoProxyCreator

All Implemented Interfaces:
Serializable, AopInfrastructureBean, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor, org.springframework.core.Ordered

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.

Since:
2.0
Author:
Rod Johnson, Juergen Hoeller
See Also:
  • Constructor Details

    • AnnotationAwareAspectJAutoProxyCreator

      public AnnotationAwareAspectJAutoProxyCreator()
  • Method Details

    • setIncludePatterns

      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.

    • setAspectJAdvisorFactory

      public void setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)
    • initBeanFactory

      protected void initBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
      Overrides:
      initBeanFactory in class AbstractAdvisorAutoProxyCreator
    • findCandidateAdvisors

      protected List<Advisor> findCandidateAdvisors()
      Description copied from class: AbstractAdvisorAutoProxyCreator
      Find all candidate Advisors to use in auto-proxying.
      Overrides:
      findCandidateAdvisors in class AbstractAdvisorAutoProxyCreator
      Returns:
      the List of candidate Advisors
    • isInfrastructureClass

      protected boolean isInfrastructureClass(Class<?> beanClass)
      Description copied from class: AbstractAutoProxyCreator
      Return whether the given bean class represents an infrastructure class that should never be proxied.

      The default implementation considers Advices, Advisors and AopInfrastructureBeans as infrastructure classes.

      Overrides:
      isInfrastructureClass in class AbstractAutoProxyCreator
      Parameters:
      beanClass - the class of the bean
      Returns:
      whether the bean represents an infrastructure class
      See Also:
    • isEligibleAspectBean

      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.