|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.framework.ProxyConfig org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
Abstract BeanPostProcessor implementation that creates AOP proxies. This class is completely generic; it contains no special code to handle any particular aspects, such as pooling aspects.
Subclasses must implement the abstract findCandidateAdvisors() method to return a list of Advisors applying to any object. Subclasses can also override the inherited shouldSkip() method to exclude certain objects from autoproxying, but they must be careful to invoke the shouldSkip() method of this class, which tries to avoid circular reference problems and infinite loops.
Advisors or advices requiring ordering should implement the Ordered interface. This class sorts advisors by Ordered order value. Advisors that don't implement the Ordered interface will be considered to be unordered, and will appear at the end of the advisor chain in undefined order.
findCandidateAdvisors()
Field Summary |
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator |
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS |
Fields inherited from class org.springframework.aop.framework.ProxyConfig |
exposeProxy |
Constructor Summary | |
AbstractAdvisorAutoProxyCreator()
|
Method Summary | |
protected abstract java.util.List |
findCandidateAdvisors()
Find all candidate advices to use in auto proxying. |
protected java.util.List |
findEligibleAdvisors(java.lang.Class clazz)
Find all eligible advices and for autoproxying this class. |
protected java.lang.Object[] |
getInterceptorsAndAdvisorsForBean(java.lang.Object bean,
java.lang.String name)
Return whether the given bean is to be proxied, and what additional interceptors and pointcuts to apply. |
void |
setBeanFactory(BeanFactory beanFactory)
We override this method to ensure that all candidate advisors are materialized under a stack trace including this bean. |
protected boolean |
shouldSkip(java.lang.Object bean,
java.lang.String name)
We override this to ensure that we don't get into circular reference hell when our own infrastructure (such as this class) depends on advisors that depend on beans... |
protected java.util.List |
sortAdvisors(java.util.List advisors)
Sort advisors based on ordering. |
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator |
getBeanFactory, getOrder, isInfrastructureClass, postProcessAfterInitialization, postProcessBeforeInitialization, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setCustomTargetSourceCreators, setInterceptorNames, setOrder |
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
copyFrom, getAopProxyFactory, getExposeProxy, getOptimize, getProxyTargetClass, isFrozen, setAopProxyFactory, setExposeProxy, setFrozen, setOptimize, setProxyTargetClass, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AbstractAdvisorAutoProxyCreator()
Method Detail |
public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
setBeanFactory
in class AbstractAutoProxyCreator
protected java.lang.Object[] getInterceptorsAndAdvisorsForBean(java.lang.Object bean, java.lang.String name)
AbstractAutoProxyCreator
getInterceptorsAndAdvisorsForBean
in class AbstractAutoProxyCreator
bean
- the new bean instancename
- the name of the bean
AbstractAutoProxyCreator.postProcessAfterInitialization(java.lang.Object, java.lang.String)
,
AbstractAutoProxyCreator.DO_NOT_PROXY
,
AbstractAutoProxyCreator.PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
protected java.util.List findEligibleAdvisors(java.lang.Class clazz)
findCandidateAdvisors()
protected java.util.List sortAdvisors(java.util.List advisors)
Ordered
protected boolean shouldSkip(java.lang.Object bean, java.lang.String name)
shouldSkip
in class AbstractAutoProxyCreator
bean
- the new bean instancename
- the name of the beanControlFlow
protected abstract java.util.List findCandidateAdvisors()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |