org.springframework.aop.framework.autoproxy
Class AdvisorAutoProxyCreator
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
org.springframework.aop.framework.autoproxy.AdvisorAutoProxyCreator
- All Implemented Interfaces:
- BeanFactoryAware, BeanNameAware, BeanPostProcessor, Ordered
- public class AdvisorAutoProxyCreator
- extends AbstractAdvisorAutoProxyCreator
- implements 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 AdvisorAutoProxyCreator'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.
- Version:
- $Id: AdvisorAutoProxyCreator.java,v 1.7 2004/03/18 02:46:16 trisberg Exp $
- Author:
- Rod Johnson
Field Summary |
static java.lang.String |
SEPARATOR
Separator between prefix and remainder of bean name |
Method Summary |
protected java.util.List |
findCandidateAdvisors()
Find all candidate advices to use in auto proxying. |
java.lang.String |
getAdvisorBeanNamePrefix()
Return the prefix for bean names that will cause them not to
be considered for autoproxying by this object. |
boolean |
getUsePrefix()
|
void |
setAdvisorBeanNamePrefix(java.lang.String infrastructureBeanNamePrefix)
Set the prefix for bean names that will cause them to be excluded for
autoproxying by this object. |
void |
setBeanName(java.lang.String name)
Set the name of the bean in the bean factory that created this bean. |
void |
setUsePrefix(boolean usePrefix)
|
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
copyFrom, getAopProxyFactory, getExposeProxy, getOptimize, getProxyTargetClass, isFrozen, setAopProxyFactory, setExposeProxy, setFrozen, setOptimize, setProxyTargetClass, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SEPARATOR
public static final java.lang.String SEPARATOR
- Separator between prefix and remainder of bean name
- See Also:
- Constant Field Values
AdvisorAutoProxyCreator
public AdvisorAutoProxyCreator()
getAdvisorBeanNamePrefix
public java.lang.String getAdvisorBeanNamePrefix()
- Return the prefix for bean names that will cause them not to
be considered for autoproxying by this object.
setAdvisorBeanNamePrefix
public void setAdvisorBeanNamePrefix(java.lang.String infrastructureBeanNamePrefix)
- Set the prefix for bean names that will cause them to be excluded for
autoproxying by this object. This prefix should be set to avoid
circular references. Default value is the bean name of this object.
- Parameters:
infrastructureBeanNamePrefix
- new exclusion prefix
getUsePrefix
public boolean getUsePrefix()
- Returns:
- Returns the usePrefix.
setUsePrefix
public void setUsePrefix(boolean usePrefix)
- Parameters:
usePrefix
- The usePrefix to set.
setBeanName
public void setBeanName(java.lang.String name)
- Description copied from interface:
BeanNameAware
- Set the name of the bean in the bean factory that created this bean.
Invoked after population of normal bean properties but before an init
callback like InitializingBean's afterPropertiesSet or a custom init-method.
- Specified by:
setBeanName
in interface BeanNameAware
- Parameters:
name
- the name of the bean in the factory- See Also:
BeanNameAware.setBeanName(java.lang.String)
findCandidateAdvisors
protected java.util.List findCandidateAdvisors()
- Find all candidate advices to use in auto proxying.
- Specified by:
findCandidateAdvisors
in class AbstractAdvisorAutoProxyCreator
- Returns:
- list of Advice
Copyright (C) 2003-2004 The Spring Framework Project.