类 BeanNameAutoProxyCreator
java.lang.Object
infra.aop.framework.ProxyConfig
infra.aop.framework.ProxyProcessorSupport
infra.aop.framework.autoproxy.AbstractAutoProxyCreator
infra.aop.framework.autoproxy.BeanNameAutoProxyCreator
- 所有已实现的接口:
AopInfrastructureBean,ProxyCreator,infra.beans.factory.Aware,infra.beans.factory.BeanClassLoaderAware,infra.beans.factory.BeanFactoryAware,infra.beans.factory.config.BeanPostProcessor,infra.beans.factory.config.InstantiationAwareBeanPostProcessor,infra.beans.factory.config.SmartInstantiationAwareBeanPostProcessor,infra.beans.factory.InitializationBeanPostProcessor,infra.core.Ordered,Serializable
Auto proxy creator that identifies beans to proxy via a list of names.
Checks for direct, "xxx*", and "*xxx" matches.
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.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Sam Brannen
- 另请参阅:
-
字段概要
字段从类继承的字段 infra.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS从接口继承的字段 infra.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected Object[]getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, TargetSource targetSource) Identify as a bean to proxy if the bean name matches one of the names in the configured list of supported names.protected TargetSourcegetCustomTargetSource(Class<?> beanClass, String beanName) Delegate toAbstractAutoProxyCreator.getCustomTargetSource(Class, String)if the bean name matches one of the names in the configured list of supported names, returningnullotherwise.protected booleanDetermine if the given bean name matches the mapped name.private booleanisSupportedBeanName(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.voidsetBeanNames(String... beanNames) Set the names of the beans that should automatically get wrapped with proxies.从类继承的方法 infra.aop.framework.autoproxy.AbstractAutoProxyCreator
advisorsPreFiltered, buildAdvisors, createProxy, customizeProxyFactory, determineBeanType, determineCandidateConstructors, getBeanFactory, getCacheKey, getEarlyBeanReference, getTargetSource, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessBeforeInstantiation, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanFactory, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, shouldProxyTargetClass, shouldSkip, wrapIfNecessary从类继承的方法 infra.aop.framework.ProxyProcessorSupport
evaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoader从类继承的方法 infra.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 infra.beans.factory.InitializationBeanPostProcessor
postProcessBeforeInitialization从接口继承的方法 infra.beans.factory.config.InstantiationAwareBeanPostProcessor
postProcessAfterInstantiation
-
字段详细资料
-
NO_ALIASES
-
beanNames
-
-
构造器详细资料
-
BeanNameAutoProxyCreator
public BeanNameAutoProxyCreator()
-
-
方法详细资料
-
setBeanNames
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 If you intend to proxy a FactoryBean instance itself ,specify the bean name of the FactoryBean including the factory-bean prefix "&": e.g. "&myFactoryBean".
- 另请参阅:
-
FactoryBeanBeanFactory.FACTORY_BEAN_PREFIX
-
getCustomTargetSource
Delegate toAbstractAutoProxyCreator.getCustomTargetSource(Class, String)if the bean name matches one of the names in the configured list of supported names, returningnullotherwise. -
getAdvicesAndAdvisorsForBean
@Nullable protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, @Nullable TargetSource targetSource) Identify as a bean to proxy if the bean name matches one of the names in the configured list of supported names.- 指定者:
getAdvicesAndAdvisorsForBean在类中AbstractAutoProxyCreator- 参数:
beanClass- the class of the bean to advisebeanName- the name of the beantargetSource- the TargetSource returned by theAbstractAutoProxyCreator.getCustomTargetSource(java.lang.Class<?>, java.lang.String)method: may be ignored. Will benullif no custom target source is in use.- 返回:
- an array of additional interceptors for the particular bean;
or an empty array if no additional interceptors but just the common ones;
or
nullif no proxy at all, not even with the common interceptors. See constants DO_NOT_PROXY and PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS. - 另请参阅:
-
isSupportedBeanName
Determine if the bean name for the given bean class matches one of the names in the configured list of supported names.- 参数:
beanClass- the class of the bean to advisebeanName- the name of the bean- 返回:
trueif the given bean name is supported- 另请参阅:
-
isMatch
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.
- 参数:
beanName- the bean name to checkmappedName- the name in the configured list of names- 返回:
- if the names match
-