类 DefaultAdvisorAutoProxyCreator
- java.lang.Object
- org.springframework.aop.framework.ProxyConfig
- org.springframework.aop.framework.ProxyProcessorSupport
- org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
- org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
- org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator
- 所有已实现的接口:
Serializable
,AopInfrastructureBean
,Aware
,BeanClassLoaderAware
,BeanFactoryAware
,BeanNameAware
,BeanPostProcessor
,InstantiationAwareBeanPostProcessor
,SmartInstantiationAwareBeanPostProcessor
,Ordered
public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements BeanNameAware
BeanPostProcessor
implementation that creates AOP proxies based on all candidateAdvisor
s in the currentBeanFactory
. 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 theadvisorBeanNamePrefix
property. The separator (.) will also be used in this case.- 作者:
- Rod Johnson, Rob Harrop
- 另请参阅:
- 序列化表格
字段概要
从类继承的字段 org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 DefaultAdvisorAutoProxyCreator()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getAdvisorBeanNamePrefix()
Return the prefix for bean names that will cause them to be included for auto-proxying by this object.protected boolean
isEligibleAdvisorBean(String beanName)
ConsiderAdvisor
beans with the specified prefix as eligible, if activated.boolean
isUsePrefix()
Return whether to only include 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 only include advisors with a certain prefix in the bean name.从类继承的方法 org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
advisorsPreFiltered, extendAdvisors, findAdvisorsThatCanApply, findCandidateAdvisors, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, initBeanFactory, setBeanFactory, sortAdvisors
从类继承的方法 org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, shouldProxyTargetClass, shouldSkip, wrapIfNecessary
从类继承的方法 org.springframework.aop.framework.ProxyProcessorSupport
evaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoader
从类继承的方法 org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
构造器详细资料
DefaultAdvisorAutoProxyCreator
public DefaultAdvisorAutoProxyCreator()
方法详细资料
setUsePrefix
public void setUsePrefix(boolean usePrefix)
Set whether to only include advisors with a certain prefix in the bean name.Default is
false
, including all beans of typeAdvisor
.
isUsePrefix
public boolean isUsePrefix()
Return whether to only include 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.- 参数:
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)
从接口复制的说明: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 such as
InitializingBean.afterPropertiesSet()
or a custom init-method.- 指定者:
setBeanName
在接口中BeanNameAware
- 参数:
name
- the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use theBeanFactoryUtils.originalBeanName(String)
method to extract the original bean name (without suffix), if desired.
isEligibleAdvisorBean
protected boolean isEligibleAdvisorBean(String beanName)
ConsiderAdvisor
beans with the specified prefix as eligible, if activated.- 覆盖:
isEligibleAdvisorBean
在类中AbstractAdvisorAutoProxyCreator
- 参数:
beanName
- the name of the Advisor bean- 返回:
- whether the bean is eligible
- 另请参阅:
setUsePrefix(boolean)
,setAdvisorBeanNamePrefix(java.lang.String)