站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

DefaultAdvisorAutoProxyCreator (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.aop.framework.autoproxy
Class DefaultAdvisorAutoProxyCreator

java.lang.Object
  extended by org.springframework.aop.framework.ProxyConfig
      extended by org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
          extended by org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
              extended by org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, BeanFactoryAware, BeanNameAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, Ordered

public class DefaultAdvisorAutoProxyCreator
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 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
See Also:
Serialized Form

Field Summary
static String SEPARATOR
          Separator between prefix and remainder of bean name
 
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
 
Fields inherited from class org.springframework.aop.framework.ProxyConfig
exposeProxy, logger
 
Constructor Summary
DefaultAdvisorAutoProxyCreator()
           
 
Method Summary
protected  List findCandidateAdvisors()
          Find all candidate advices to use in auto-proxying.
 String getAdvisorBeanNamePrefix()
          Return the prefix for bean names that will cause them to be included for auto-proxying by this object.
 boolean isUsePrefix()
          Return whether to exclude advisors with a certain prefix in the bean name.
 void setAdvisorBeanNamePrefix(String advisorBeanNamePrefix)
          Set the prefix for bean names that will cause them to be included for auto-proxying by this object.
 void setBeanName(String name)
          Set the name of the bean in the bean factory that created this bean.
 void setUsePrefix(boolean usePrefix)
          Set whether to exclude advisors with a certain prefix in the bean name.
 
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
findEligibleAdvisors, getAdvicesAndAdvisorsForBean, setBeanFactory, shouldSkip, sortAdvisors
 
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
createProxy, customizeProxyFactory, getBeanFactory, getCustomTargetSource, getOrder, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessBeforeInitialization, postProcessBeforeInstantiation, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder
 
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, getAopProxyFactory, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setAopProxyFactory, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static final String SEPARATOR
Separator between prefix and remainder of bean name

See Also:
Constant Field Values
Constructor Detail

DefaultAdvisorAutoProxyCreator

public DefaultAdvisorAutoProxyCreator()
Method Detail

setUsePrefix

public void setUsePrefix(boolean usePrefix)
Set whether to exclude advisors with a certain prefix in the bean name.


isUsePrefix

public boolean isUsePrefix()
Return whether to exclude advisors with a certain prefix in the bean name.


setAdvisorBeanNamePrefix

public void setAdvisorBeanNamePrefix(String advisorBeanNamePrefix)
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.

Parameters:
advisorBeanNamePrefix - the exclusion prefix

getAdvisorBeanNamePrefix

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


setBeanName

public void setBeanName(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

findCandidateAdvisors

protected List findCandidateAdvisors()
Find all candidate advices to use in auto-proxying.

Specified by:
findCandidateAdvisors in class AbstractAdvisorAutoProxyCreator
Returns:
list of Advice


Copyright (c) 2002-2007 The Spring Framework Project.