|
The Spring Framework | |||||||||
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
public abstract class 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 auto-proxying, but they must be careful to invoke the base
shouldSkip
method, 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()
,
AopUtils
,
Serialized FormField Summary |
---|
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator |
---|
DO_NOT_PROXY, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS |
Fields inherited from class org.springframework.aop.framework.ProxyConfig |
---|
exposeProxy, logger |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
AbstractAdvisorAutoProxyCreator()
|
Method Summary | |
---|---|
protected void |
extendCandidateAdvisors(List candidateAdvisors)
Extension hook that subclasses can choose to use to additional Advisors, given the sorted Advisors obtained to date. |
protected List |
findCandidateAdvisors()
Find all candidate advisors to use in auto-proxying. |
protected List |
findEligibleAdvisors(Class clazz)
Find all eligible advices for auto-proxying this class. |
protected Object[] |
getAdvicesAndAdvisorsForBean(Class beanClass,
String name,
TargetSource targetSource)
Return whether the given bean is to be proxied, what additional advices (e.g. |
protected boolean |
isEligibleAdvisorBean(String beanName)
Return whether the Advisor bean with the given name is eligible for proxying in the first place. |
protected List |
sortAdvisors(List advisors)
Sort advisors based on ordering. |
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator |
---|
createProxy, customizeProxyFactory, getBeanFactory, getCustomTargetSource, getOrder, isFrozen, isInfrastructureClass, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanFactory, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, shouldSkip |
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
---|
copyFrom, getAopProxyFactory, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setAopProxyFactory, setExposeProxy, setOpaque, 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 |
---|
protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String name, TargetSource targetSource)
AbstractAutoProxyCreator
The previous name of this method was "getInterceptorAndAdvisorForBean". It has been renamed in the course of general terminology clarification in Spring 1.1. An AOP Alliance Interceptor is just a special form of Advice, so the generic Advice term is preferred now.
The third parameter, customTargetSource, is new in Spring 1.1; add it to existing implementations of this method.
getAdvicesAndAdvisorsForBean
in class AbstractAutoProxyCreator
beanClass
- the class of the bean to advisename
- the name of the beantargetSource
- targetSource returned by getTargetSource() method:
may be ignored. Will be null
unless a custom target source is in use.
null
if no proxy at all, not even with the common interceptors.
See constants DO_NOT_PROXY and PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS.AbstractAutoProxyCreator.postProcessAfterInitialization(java.lang.Object, java.lang.String)
,
AbstractAutoProxyCreator.DO_NOT_PROXY
,
AbstractAutoProxyCreator.PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
protected List findEligibleAdvisors(Class clazz)
findCandidateAdvisors()
protected List sortAdvisors(List advisors)
Ordered
,
OrderComparator
protected List findCandidateAdvisors()
protected boolean isEligibleAdvisorBean(String beanName)
beanName
- the name of the Advisor beanprotected void extendCandidateAdvisors(List candidateAdvisors)
Typically used to add Advisors that expose contextual information required by some of the later advisors.
candidateAdvisors
- Advisors that have already been identified as
applying to a given bean
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |