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

public Class AnnotationAwareAspectJAutoProxyCreator

extends AspectJAwareAdvisorAutoProxyCreator
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.util.ArrayList, .List, java.util.regex.Pattern, org.springframework.aop.Advisor, org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, org.springframework.lang.Nullable, org.springframework.util.Assert

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 org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.

Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
AnnotationAwareAspectJAutoProxyCreator.BeanFactoryAspectJAdvisorsBuilderAdapter

Subclass of BeanFactoryAspectJAdvisorsBuilderAdapter that delegates to surrounding AnnotationAwareAspectJAutoProxyCreator facilities.

Field Summary

Modifier and TypeField and Description
private AspectJAdvisorFactory
private BeanFactoryAspectJAdvisorsBuilder
private List<Pattern>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected List<Advisor>
protected void
protected boolean
isEligibleAspectBean(String beanName)

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

protected boolean
isInfrastructureClass(Class<?>
the class of the bean
beanClass
)

Overrides org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.isInfrastructureClass.

Return whether the given bean class represents an infrastructure class that should never be proxied.
public void
public void
setIncludePatterns(List<String> patterns)

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

Inherited from org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator:
extendAdvisorsshouldSkipsortAdvisors

Field Detail

aspectJAdvisorFactoryback to summary
private AspectJAdvisorFactory aspectJAdvisorFactory
Annotations
@Nullable
aspectJAdvisorsBuilderback to summary
private BeanFactoryAspectJAdvisorsBuilder aspectJAdvisorsBuilder
Annotations
@Nullable
includePatternsback to summary
private List<Pattern> includePatterns
Annotations
@Nullable

Constructor Detail

AnnotationAwareAspectJAutoProxyCreatorback to summary
public AnnotationAwareAspectJAutoProxyCreator()

Method Detail

findCandidateAdvisorsback to summary
protected List<Advisor> findCandidateAdvisors()

Overrides org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors.

Doc from org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors.

Find all candidate Advisors to use in auto-proxying.

Returns:List<Advisor>

the List of candidate Advisors

Annotations
@Override
initBeanFactoryback to summary
protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory)

Overrides org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.initBeanFactory.

Annotations
@Override
isEligibleAspectBeanback to summary
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.

isInfrastructureClassback to summary
protected boolean isInfrastructureClass(Class<?> beanClass)

Overrides org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.isInfrastructureClass.

Doc from org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.isInfrastructureClass.

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.

Parameters
beanClass:Class<?>

the class of the bean

Returns:boolean

whether the bean represents an infrastructure class

Annotations
@Override
setAspectJAdvisorFactoryback to summary
public void setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)
setIncludePatternsback to summary
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.

org.springframework.aop.aspectj.annotation back to summary

private Class AnnotationAwareAspectJAutoProxyCreator.BeanFactoryAspectJAdvisorsBuilderAdapter

extends BeanFactoryAspectJAdvisorsBuilder
Class Inheritance

Subclass of BeanFactoryAspectJAdvisorsBuilderAdapter that delegates to surrounding AnnotationAwareAspectJAutoProxyCreator facilities.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
isEligibleBean(String
the name of the aspect bean
beanName
)

Overrides org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder.isEligibleBean.

Return whether the aspect bean with the given name is eligible.
Inherited from org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder:
buildAspectJAdvisors

Constructor Detail

BeanFactoryAspectJAdvisorsBuilderAdapterback to summary
public BeanFactoryAspectJAdvisorsBuilderAdapter(ListableBeanFactory beanFactory, AspectJAdvisorFactory advisorFactory)

Method Detail

isEligibleBeanback to summary
protected boolean isEligibleBean(String beanName)

Overrides org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder.isEligibleBean.

Doc from org.springframework.aop.aspectj.annotation.BeanFactoryAspectJAdvisorsBuilder.isEligibleBean.

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

Annotations
@Override