类 AbstractAdvisorAutoProxyCreator
- 所有已实现的接口:
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
- 直接已知子类:
AspectJAwareAdvisorAutoProxyCreator,DefaultAdvisorAutoProxyCreator,InfrastructureAdvisorAutoProxyCreator
Subclasses may override the findCandidateAdvisors() method to
return a custom list of Advisors applying to any object. Subclasses can
also override the inherited AbstractAutoProxyCreator.shouldSkip(java.lang.Class<?>, java.lang.String) method to exclude certain
objects from auto-proxying.
Advisors or advices requiring ordering should be annotated with
@Order or implement the
Ordered interface. This class sorts
advisors using the AnnotationAwareOrderComparator. Advisors that are
not annotated with @Order or don't implement the Ordered
interface will be considered as unordered; they will appear at the end of the
advisor chain in an undefined order.
- 从以下版本开始:
- 4.0
- 作者:
- Rod Johnson, Juergen Hoeller, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private classSubclass of BeanFactoryAdvisorRetrievalHelper that delegates to surrounding AbstractAdvisorAutoProxyCreator facilities. -
字段概要
字段从类继承的字段 infra.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS从接口继承的字段 infra.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected booleanThis auto-proxy creator always returns pre-filtered Advisors.protected voidextendAdvisors(List<Advisor> candidateAdvisors) Extension hook that subclasses can override to register additional Advisors, given the sorted Advisors obtained to date.findAdvisorsThatCanApply(List<Advisor> candidateAdvisors, Class<?> beanClass, String beanName) Search the given candidate Advisors to find all Advisors that can apply to the specified bean.Find all candidate Advisors to use in auto-proxying.findEligibleAdvisors(Class<?> beanClass, String beanName) Find all eligible Advisors for auto-proxying this class.protected Object[]getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, TargetSource targetSource) Return whether the given bean is to be proxied, what additional advices (e.g.protected voidinitBeanFactory(infra.beans.factory.config.ConfigurableBeanFactory beanFactory) protected booleanisEligibleAdvisorBean(String beanName) Return whether the Advisor bean with the given name is eligible for proxying in the first place.voidsetBeanFactory(infra.beans.factory.BeanFactory beanFactory) sortAdvisors(List<Advisor> advisors) Sort advisors based on ordering.从类继承的方法 infra.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, determineBeanType, determineCandidateConstructors, getBeanFactory, getCacheKey, getCustomTargetSource, getEarlyBeanReference, getTargetSource, isFrozen, isInfrastructureClass, postProcessAfterInitialization, postProcessBeforeInstantiation, predictBeanType, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, 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
-
字段详细资料
-
advisorRetriever
-
-
构造器详细资料
-
AbstractAdvisorAutoProxyCreator
public AbstractAdvisorAutoProxyCreator()
-
-
方法详细资料
-
setBeanFactory
public void setBeanFactory(infra.beans.factory.BeanFactory beanFactory) - 指定者:
setBeanFactory在接口中infra.beans.factory.BeanFactoryAware- 覆盖:
setBeanFactory在类中AbstractAutoProxyCreator
-
initBeanFactory
protected void initBeanFactory(infra.beans.factory.config.ConfigurableBeanFactory beanFactory) -
getAdvicesAndAdvisorsForBean
@Nullable protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, @Nullable TargetSource targetSource) 从类复制的说明:AbstractAutoProxyCreatorReturn whether the given bean is to be proxied, what additional advices (e.g. AOP Alliance interceptors) and advisors to apply.- 指定者:
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. - 另请参阅:
-
findEligibleAdvisors
Find all eligible Advisors for auto-proxying this class.- 参数:
beanClass- the clazz to find advisors forbeanName- the name of the currently proxied bean- 返回:
- the empty List, not
null, if there are no pointcuts or interceptors - 另请参阅:
-
findCandidateAdvisors
Find all candidate Advisors to use in auto-proxying.- 返回:
- the List of candidate Advisors
-
findAdvisorsThatCanApply
protected List<Advisor> findAdvisorsThatCanApply(List<Advisor> candidateAdvisors, Class<?> beanClass, String beanName) Search the given candidate Advisors to find all Advisors that can apply to the specified bean.- 参数:
candidateAdvisors- the candidate AdvisorsbeanClass- the target's bean classbeanName- the target's bean name- 返回:
- the List of applicable Advisors
- 另请参阅:
-
isEligibleAdvisorBean
Return whether the Advisor bean with the given name is eligible for proxying in the first place.- 参数:
beanName- the name of the Advisor bean- 返回:
- whether the bean is eligible
-
sortAdvisors
Sort advisors based on ordering. Subclasses may choose to override this method to customize the sorting strategy.- 参数:
advisors- the source List of Advisors- 返回:
- the sorted List of Advisors
- 另请参阅:
-
OrderedOrderAnnotationAwareOrderComparator
-
extendAdvisors
Extension hook that subclasses can override to register additional Advisors, given the sorted Advisors obtained to date.The default implementation is empty.
Typically used to add Advisors that expose contextual information required by some of the later advisors.
- 参数:
candidateAdvisors- the Advisors that have already been identified as applying to a given bean
-
advisorsPreFiltered
protected boolean advisorsPreFiltered()This auto-proxy creator always returns pre-filtered Advisors.- 覆盖:
advisorsPreFiltered在类中AbstractAutoProxyCreator- 返回:
- whether the Advisors are pre-filtered
- 另请参阅:
-