Class SimpleBeanFactoryAwareAspectInstanceFactory

java.lang.Object
org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
All Implemented Interfaces:
AspectInstanceFactory, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered

public class SimpleBeanFactoryAwareAspectInstanceFactory extends Object implements AspectInstanceFactory, org.springframework.beans.factory.BeanFactoryAware
Implementation of AspectInstanceFactory that locates the aspect from the BeanFactory using a configured bean name.
Since:
2.0
Author:
Rob Harrop, Juergen Hoeller
  • Constructor Details

    • SimpleBeanFactoryAwareAspectInstanceFactory

      public SimpleBeanFactoryAwareAspectInstanceFactory()
  • Method Details

    • setAspectBeanName

      public void setAspectBeanName(String aspectBeanName)
      Set the name of the aspect bean. This is the bean that is returned when calling getAspectInstance().
    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
    • getAspectInstance

      public Object getAspectInstance()
      Look up the aspect bean from the BeanFactory and return it.
      Specified by:
      getAspectInstance in interface AspectInstanceFactory
      Returns:
      the aspect instance (never null)
      See Also:
    • getAspectClassLoader

      @Nullable public ClassLoader getAspectClassLoader()
      Description copied from interface: AspectInstanceFactory
      Expose the aspect class loader that this factory uses.
      Specified by:
      getAspectClassLoader in interface AspectInstanceFactory
      Returns:
      the aspect class loader (or null for the bootstrap loader)
      See Also:
      • ClassUtils.getDefaultClassLoader()
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered