org.springframework.aop.framework.autoproxy
public class: DefaultAdvisorAutoProxyCreator [javadoc |
source]
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.DefaultAdvisorAutoProxyCreator
All Implemented Interfaces:
BeanNameAware, Ordered, BeanClassLoaderAware, AopInfrastructureBean, SmartInstantiationAwareBeanPostProcessor, BeanFactoryAware, Serializable
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
- author:
Rob - Harrop
| Field Summary |
|---|
| public static final String | SEPARATOR | Separator between prefix and remainder of bean name |
| Methods from org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator: |
|---|
|
advisorsPreFiltered, buildAdvisors, createProxy, customizeProxyFactory, determineCandidateConstructors, getAdvicesAndAdvisorsForBean, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getOrder, isFrozen, isInfrastructureClass, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setBeanFactory, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, setProxyClassLoader, shouldProxyTargetClass, shouldSkip, wrapIfNecessary |
| Methods from org.springframework.aop.framework.ProxyConfig: |
|---|
|
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString |
| Method from org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator Detail: |
public String getAdvisorBeanNamePrefix() {
return this.advisorBeanNamePrefix;
}
Return the prefix for bean names that will cause them to be included
for auto-proxying by this object. |
protected boolean isEligibleAdvisorBean(String beanName) {
return (!isUsePrefix() || beanName.startsWith(getAdvisorBeanNamePrefix()));
}
Consider Advisor beans with the specified prefix as eligible, if activated. |
public boolean isUsePrefix() {
return this.usePrefix;
}
Return whether to exclude advisors with a certain prefix
in the bean name. |
public void setAdvisorBeanNamePrefix(String advisorBeanNamePrefix) {
this.advisorBeanNamePrefix = 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. |
public void setBeanName(String name) {
// If no infrastructure bean name prefix has been set, override it.
if (this.advisorBeanNamePrefix == null) {
this.advisorBeanNamePrefix = name + SEPARATOR;
}
}
|
public void setUsePrefix(boolean usePrefix) {
this.usePrefix = usePrefix;
}
Set whether to exclude advisors with a certain prefix
in the bean name. |