org.springframework.aop.aspectj.annotation
Class AnnotationAwareAspectJAutoProxyCreator
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator
org.springframework.aop.aspectj.autoproxy.AspectJInvocationContextExposingAdvisorAutoProxyCreator
org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
- All Implemented Interfaces:
- Serializable, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, Ordered
public class AnnotationAwareAspectJAutoProxyCreator
- extends AspectJInvocationContextExposingAdvisorAutoProxyCreator
AspectJInvocationContextExposingAdvisorAutoProxyCreator subclass that processes all
AspectJ annotation classes in the current application context, as well as Spring Advisors.
Any AspectJ annotated classes will automatically be recognized, and their advice
applied if Spring AOP's proxy-based model is capable of applying it.
This covers method execution joinpoints.
If the <aop:include> element is used, only @AspectJ beans with names matched by
an include pattern will be considered as defining aspects to use for Spring autoproxying.
Processing of Spring Advisors follows the rules established in
DefaultAdvisorAutoProxyCreator
.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
DefaultAdvisorAutoProxyCreator
,
AspectJAdvisorFactory
,
Serialized Form
Methods inherited from class org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator |
createProxy, customizeProxyFactory, getBeanFactory, getCustomTargetSource, getOrder, isFrozen, 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 |
AnnotationAwareAspectJAutoProxyCreator
public AnnotationAwareAspectJAutoProxyCreator()
isInfrastructureClass
protected boolean isInfrastructureClass(Class beanClass)
- Description copied from class:
AbstractAutoProxyCreator
- Return whether the given bean class and bean name represents an
infrastructure class that should never be proxied.
Default implementation considers Advisors, MethodInterceptors
and AbstractAutoProxyCreators as infrastructure classes.
- Overrides:
isInfrastructureClass
in class AbstractAutoProxyCreator
- Parameters:
beanClass
- the class of the bean
- Returns:
- whether the bean represents an infrastructure class
- See Also:
Advisor
,
MethodInterceptor
,
AbstractAutoProxyCreator.shouldSkip(java.lang.Class, java.lang.String)
setAspectJAdvisorFactory
public void setAspectJAdvisorFactory(AspectJAdvisorFactory aspectJAdvisorFactory)
setIncludePatterns
public void setIncludePatterns(List<String> patterns)
findCandidateAdvisors
protected List findCandidateAdvisors()
- Description copied from class:
AbstractAdvisorAutoProxyCreator
- Find all candidate advisors to use in auto-proxying.
- Overrides:
findCandidateAdvisors
in class AbstractAdvisorAutoProxyCreator
- Returns:
- list of Advisors
createAspectJAdvisors
public List<Advisor> createAspectJAdvisors(AspectJAdvisorFactory aspectJAdvisorFactory,
ListableBeanFactory beanFactory)
throws BeansException,
IllegalStateException
- Look for AspectJ annotated aspect classes in the current bean factory,
and return to a list of Spring AOP advisors representing them.
Create a Spring Advisor for each advice method
- Parameters:
aspectJAdvisorFactory
- the AdvisorFactory to usebeanFactory
- the BeanFactory to look for AspectJ annotated aspects in
- Returns:
- a list of Spring AOP advisors resulting from AspectJ annotated
classes in the current Spring bean factory
- Throws:
BeansException
IllegalStateException
Copyright © 2002-2006 The Spring Framework.