org.springframework.aop.aspectj.annotation
Class BeanFactoryAspectJAdvisorsBuilder

java.lang.Object
  extended by org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder
Direct Known Subclasses:
AnnotationAwareAspectJAutoProxyCreator.BeanFactoryAspectJAdvisorsBuilderAdapter

public class BeanFactoryAspectJAdvisorsBuilder
extends java.lang.Object

Helper for retrieving @AspectJ beans from a BeanFactory and building Spring Advisors based on them, for use with auto-proxying.

Since:
2.0.2
Author:
Juergen Hoeller
See Also:
AnnotationAwareAspectJAutoProxyCreator

Field Summary
private  AspectJAdvisorFactory advisorFactory
           
private  java.util.Map<java.lang.String,java.util.List<Advisor>> advisorsCache
           
private  java.util.List<java.lang.String> aspectBeanNames
           
private  java.util.Map<java.lang.String,MetadataAwareAspectInstanceFactory> aspectFactoryCache
           
private  ListableBeanFactory beanFactory
           
 
Constructor Summary
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory)
          Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory, AspectJAdvisorFactory advisorFactory)
          Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
 
Method Summary
 java.util.List<Advisor> buildAspectJAdvisors()
          Look for AspectJ-annotated aspect beans in the current bean factory, and return to a list of Spring AOP Advisors representing them.
protected  boolean isEligibleBean(java.lang.String beanName)
          Return whether the aspect bean with the given name is eligible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanFactory

private final ListableBeanFactory beanFactory

advisorFactory

private final AspectJAdvisorFactory advisorFactory

aspectBeanNames

private java.util.List<java.lang.String> aspectBeanNames

advisorsCache

private final java.util.Map<java.lang.String,java.util.List<Advisor>> advisorsCache

aspectFactoryCache

private final java.util.Map<java.lang.String,MetadataAwareAspectInstanceFactory> aspectFactoryCache
Constructor Detail

BeanFactoryAspectJAdvisorsBuilder

public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory)
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to scan

BeanFactoryAspectJAdvisorsBuilder

public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory,
                                         AspectJAdvisorFactory advisorFactory)
Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Parameters:
beanFactory - the ListableBeanFactory to scan
advisorFactory - the AspectJAdvisorFactory to build each Advisor with
Method Detail

buildAspectJAdvisors

public java.util.List<Advisor> buildAspectJAdvisors()
Look for AspectJ-annotated aspect beans in the current bean factory, and return to a list of Spring AOP Advisors representing them.

Creates a Spring Advisor for each AspectJ advice method.

Returns:
the list of Advisor beans
See Also:
isEligibleBean(java.lang.String)

isEligibleBean

protected boolean isEligibleBean(java.lang.String beanName)
Return whether the aspect bean with the given name is eligible.

Parameters:
beanName - the name of the aspect bean
Returns:
whether the bean is eligible