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.
setBeanNames, isMatch, setInterceptorNames, AbstractAutoProxyCreator
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private static final String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Object[] | getAdvicesAndAdvisorsForBean(Class<?>
the class of the bean to advise beanClass, String the name of the bean beanName, TargetSource the TargetSource returned by the
targetSource)getCustomTargetSource method: may be ignored.
Will be null if no custom target source is in use.Implements abstract org. Identify as a bean to proxy if the bean name matches one of the names in the configured list of supported names. |
| protected TargetSource | getCustomTargetSource(Class<?>
the class of the bean to create a TargetSource for beanClass, String the name of the bean beanName)Overrides org. Delegate to |
| protected boolean | |
| private boolean | Returns: true if the given bean name is supportedthe class of the bean to advise beanClass, String the name of the bean beanName)Determine if the bean name for the given bean class matches one of the names in the configured list of supported names. |
| public void | setBeanNames(String... beanNames)
Set the names of the beans that should automatically get wrapped with proxies. |
| beanNames | back to summary |
|---|---|
| private List<String> beanNames
| |
| NO_ALIASES | back to summary |
|---|---|
| private static final String[] NO_ALIASES | |
| BeanNameAutoProxyCreator | back to summary |
|---|---|
| public BeanNameAutoProxyCreator() | |
| getAdvicesAndAdvisorsForBean | back to summary |
|---|---|
| protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, TargetSource targetSource) Implements abstract org. Identify as a bean to proxy if the bean name matches one of the names in the configured list of supported names.
| |
| getCustomTargetSource | back to summary |
|---|---|
| protected TargetSource getCustomTargetSource(Class<?> beanClass, String beanName) Overrides org. Delegate to
| |
| isMatch | back to summary |
|---|---|
| protected boolean isMatch(String beanName, String mappedName) Determine if the given bean name matches the mapped name. The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.
| |
| isSupportedBeanName | back to summary |
|---|---|
| private boolean isSupportedBeanName(Class<?> beanClass, String beanName) Determine if the bean name for the given bean class matches one of the names in the configured list of supported names.
| |
| setBeanNames | back to summary |
|---|---|
| public void setBeanNames(String... beanNames) 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". | |