spring-framework / org.springframework.aop.framework.autoproxy / DefaultAdvisorAutoProxyCreator

DefaultAdvisorAutoProxyCreator

open class DefaultAdvisorAutoProxyCreator : AbstractAdvisorAutoProxyCreator, BeanNameAware

BeanPostProcessor implementation that creates AOP proxies based on all candidate Advisors in the current BeanFactory. This class is completely generic; it contains no special code to handle any particular aspects, such as pooling aspects.

It's possible to filter out advisors - for example, to use multiple post processors of this type in the same factory - by setting the usePrefix property to true, in which case only advisors beginning with the DefaultAdvisorAutoProxyCreator's bean name followed by a dot (like "aapc.") will be used. This default prefix can be changed from the bean name by setting the advisorBeanNamePrefix property. The separator (.) will also be used in this case.

Author
Rod Johnson

Author
Rob Harrop

Constructors

<init>

DefaultAdvisorAutoProxyCreator()

BeanPostProcessor implementation that creates AOP proxies based on all candidate Advisors in the current BeanFactory. This class is completely generic; it contains no special code to handle any particular aspects, such as pooling aspects.

It's possible to filter out advisors - for example, to use multiple post processors of this type in the same factory - by setting the usePrefix property to true, in which case only advisors beginning with the DefaultAdvisorAutoProxyCreator's bean name followed by a dot (like "aapc.") will be used. This default prefix can be changed from the bean name by setting the advisorBeanNamePrefix property. The separator (.) will also be used in this case.

Properties

SEPARATOR

static val SEPARATOR: String

Separator between prefix and remainder of bean name

Functions

getAdvisorBeanNamePrefix

open fun getAdvisorBeanNamePrefix(): String

Return the prefix for bean names that will cause them to be included for auto-proxying by this object.

isUsePrefix

open fun isUsePrefix(): Boolean

Return whether to only include advisors with a certain prefix in the bean name.

setAdvisorBeanNamePrefix

open fun setAdvisorBeanNamePrefix(advisorBeanNamePrefix: String): Unit

Set the prefix for bean names that will cause them to be included for auto-proxying by this object. This prefix should be set to avoid circular references. Default value is the bean name of this object + a dot.

setBeanName

open fun setBeanName(name: String): Unit

setUsePrefix

open fun setUsePrefix(usePrefix: Boolean): Unit

Set whether to only include advisors with a certain prefix in the bean name.

Default is false, including all beans of type Advisor.