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

BeanNameAutoProxyCreator

open class BeanNameAutoProxyCreator : AbstractAutoProxyCreator

Auto proxy creator that identifies beans to proxy via a list of names. Checks for direct, "xxx*", and "*xxx" matches.

For configuration details, see the javadoc of the parent class AbstractAutoProxyCreator. Typically, you will specify a list of interceptor names to apply to all identified beans, via the "interceptorNames" property.

Author
Juergen Hoeller

Since
10.10.2003

See Also
#setBeanNames#isMatch#setInterceptorNamesAbstractAutoProxyCreator

Constructors

<init>

BeanNameAutoProxyCreator()

Auto proxy creator that identifies beans to proxy via a list of names. Checks for direct, "xxx*", and "*xxx" matches.

For configuration details, see the javadoc of the parent class AbstractAutoProxyCreator. Typically, you will specify a list of interceptor names to apply to all identified beans, via the "interceptorNames" property.

Functions

setBeanNames

open fun setBeanNames(vararg beanNames: String): Unit

Set the names of the beans that should automatically get wrapped with proxies. A name can specify a prefix to match by ending with "*", e.g. "myBean,tx*" will match the bean named "myBean" and all beans whose name start with "tx".

NOTE: In case of a FactoryBean, only the objects created by the FactoryBean will get proxied. This default behavior applies as of Spring 2.0. If you intend to proxy a FactoryBean instance itself (a rare use case, but Spring 1.2's default behavior), specify the bean name of the FactoryBean including the factory-bean prefix "&": e.g. "&myFactoryBean".