站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

AspectJAwareAdvisorAutoProxyCreator (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.aop.aspectj.autoproxy
Class AspectJAwareAdvisorAutoProxyCreator

java.lang.Object
  extended by org.springframework.aop.framework.ProxyConfig
      extended by org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
          extended by org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
              extended by org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator
All Implemented Interfaces:
Serializable, AopInfrastructureBean, BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, Ordered
Direct Known Subclasses:
AnnotationAwareAspectJAutoProxyCreator

public class AspectJAwareAdvisorAutoProxyCreator
extends AbstractAdvisorAutoProxyCreator

AbstractAdvisorAutoProxyCreator subclass that exposes AspectJ's invocation context and understands AspectJ's rules for advice precedence when multiple pieces of advice come from the same aspect.

Since:
2.0
Author:
Adrian Colyer, Juergen Hoeller
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
DO_NOT_PROXY, logger, PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AspectJAwareAdvisorAutoProxyCreator()
           
 
Method Summary
protected  void extendAdvisors(List candidateAdvisors)
          Adds an ExposeInvocationInterceptor to the beginning of the advice chain.
protected  List sortAdvisors(List advisors)
          Sort the rest by AspectJ precedence.
 
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
findCandidateAdvisors, findEligibleAdvisors, getAdvicesAndAdvisorsForBean, initBeanFactory, isEligibleAdvisorBean, setBeanFactory
 
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
buildAdvisors, createProxy, customizeProxyFactory, getBeanFactory, getCacheKey, getCustomTargetSource, getOrder, isFrozen, isInfrastructureClass, isInfrastructureClass, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, postProcessPropertyValues, setAdvisorAdapterRegistry, setApplyCommonInterceptorsFirst, setBeanClassLoader, setCustomTargetSourceCreators, setFrozen, setInterceptorNames, setOrder, shouldProxyTargetClass, shouldSkip
 
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setOpaque, setOptimize, setProxyTargetClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AspectJAwareAdvisorAutoProxyCreator

public AspectJAwareAdvisorAutoProxyCreator()
Method Detail

sortAdvisors

protected List sortAdvisors(List advisors)
Sort the rest by AspectJ precedence. If two pieces of advice have come from the same aspect they will have the same order. Advice from the same aspect is then further ordered according to the following rules:
  • if either of the pair is after advice, then the advice declared last gets highest precedence (runs last)
  • otherwise the advice declared first gets highest precedence (runs first)

Important: Advisors are sorted in precedence order, from highest precedence to lowest. "On the way in" to a join point, the highest precedence advisor should run first. "On the way out" of a join point, the highest precedence advisor should run last.

Overrides:
sortAdvisors in class AbstractAdvisorAutoProxyCreator
Parameters:
advisors - the source List of Advisors
Returns:
the sorted List of Advisors
See Also:
Ordered, OrderComparator

extendAdvisors

protected void extendAdvisors(List candidateAdvisors)
Adds an ExposeInvocationInterceptor to the beginning of the advice chain. These additional advices are needed when using AspectJ expression pointcuts and when using AspectJ-style advice.

Overrides:
extendAdvisors in class AbstractAdvisorAutoProxyCreator
Parameters:
candidateAdvisors - Advisors that have already been identified as applying to a given bean

The Spring Framework

Copyright © 2002-2007 The Spring Framework.