Top Description Fields Constructors Methods
org.springframework.aop.aspectj.annotation

public Class BeanFactoryAspectJAdvisorsBuilder

extends Object
Class Inheritance
Known Direct Subclasses
org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.BeanFactoryAspectJAdvisorsBuilderAdapter
Imports
java.util.ArrayList, .Collections, .List, .Map, java.util.concurrent.ConcurrentHashMap, org.aspectj.lang.reflect.PerClauseKind, org.springframework.aop.Advisor, org.springframework.beans.factory.BeanFactoryUtils, .ListableBeanFactory, org.springframework.lang.Nullable, org.springframework.util.Assert

Helper for retrieving @AspectJ beans from a BeanFactory and building Spring Advisors based on them, for use with auto-proxying.
Author
Juergen Hoeller
Since
2.0.2
See Also
AnnotationAwareAspectJAutoProxyCreator

Field Summary

Modifier and TypeField and Description
private final AspectJAdvisorFactory
private final Map<String, List<Advisor>>
private volatile List<String>
private final Map<String, MetadataAwareAspectInstanceFactory>
private final ListableBeanFactory

Constructor Summary

AccessConstructor and Description
public
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory
the ListableBeanFactory to scan
beanFactory
)

Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

public
BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory
the ListableBeanFactory to scan
beanFactory
,
AspectJAdvisorFactory
the AspectJAdvisorFactory to build each Advisor with
advisorFactory
)

Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Method Summary

Modifier and TypeMethod and Description
public List<Advisor>

Returns:

the list of org.springframework.aop.Advisor beans
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

Returns:

whether the bean is eligible
isEligibleBean
(String
the name of the aspect bean
beanName
)

Return whether the aspect bean with the given name is eligible.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

advisorFactoryback to summary
private final AspectJAdvisorFactory advisorFactory
advisorsCacheback to summary
private final Map<String, List<Advisor>> advisorsCache
aspectBeanNamesback to summary
private volatile List<String> aspectBeanNames
Annotations
@Nullable
aspectFactoryCacheback to summary
private final Map<String, MetadataAwareAspectInstanceFactory> aspectFactoryCache
beanFactoryback to summary
private final ListableBeanFactory beanFactory

Constructor Detail

BeanFactoryAspectJAdvisorsBuilderback to summary
public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory)

Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Parameters
beanFactory:ListableBeanFactory

the ListableBeanFactory to scan

BeanFactoryAspectJAdvisorsBuilderback to summary
public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory, AspectJAdvisorFactory advisorFactory)

Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.

Parameters
beanFactory:ListableBeanFactory

the ListableBeanFactory to scan

advisorFactory:AspectJAdvisorFactory

the AspectJAdvisorFactory to build each Advisor with

Method Detail

buildAspectJAdvisorsback to summary
public 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:List<Advisor>

the list of org.springframework.aop.Advisor beans

See Also
isEligibleBean
isEligibleBeanback to summary
protected boolean isEligibleBean(String beanName)

Return whether the aspect bean with the given name is eligible.

Parameters
beanName:String

the name of the aspect bean

Returns:boolean

whether the bean is eligible