Class AspectJProxyFactory
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AdvisedSupport
org.springframework.aop.framework.ProxyCreatorSupport
org.springframework.aop.aspectj.annotation.AspectJProxyFactory
- All Implemented Interfaces:
- Serializable,- Advised,- TargetClassAware
AspectJ-based proxy factory, allowing for programmatic building
 of proxies which include AspectJ aspects (code style as well
 annotation style).
- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller, Ramnivas Laddad
- See Also:
- 
Field SummaryFields inherited from class org.springframework.aop.framework.AdvisedSupportEMPTY_TARGET_SOURCE
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new AspectJProxyFactory.AspectJProxyFactory(Class<?>... interfaces) Create a newAspectJProxyFactory.AspectJProxyFactory(Object target) Create a new AspectJProxyFactory.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd an aspect of the supplied type to the end of the advice chain.voidAdd the supplied aspect instance to the chain.<T> TgetProxy()Create a new proxy according to the settings in this factory.<T> TgetProxy(ClassLoader classLoader) Create a new proxy according to the settings in this factory.Methods inherited from class org.springframework.aop.framework.ProxyCreatorSupportaddListener, adviceChanged, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactoryMethods inherited from class org.springframework.aop.framework.AdvisedSupportaddAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisorCount, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toStringMethods inherited from class org.springframework.aop.framework.ProxyConfigcopyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClassMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.aop.framework.AdvisedisExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy
- 
Constructor Details- 
AspectJProxyFactorypublic AspectJProxyFactory()Create a new AspectJProxyFactory.
- 
AspectJProxyFactoryCreate a new AspectJProxyFactory.Will proxy all interfaces that the given target implements. - Parameters:
- target- the target object to be proxied
 
- 
AspectJProxyFactoryCreate a newAspectJProxyFactory. No target, only interfaces. Must add interceptors.
 
- 
- 
Method Details- 
addAspectAdd the supplied aspect instance to the chain. The type of the aspect instance supplied must be a singleton aspect. True singleton lifecycle is not honoured when using this method - the caller is responsible for managing the lifecycle of any aspects added in this way.- Parameters:
- aspectInstance- the AspectJ aspect instance
 
- 
addAspectAdd an aspect of the supplied type to the end of the advice chain.- Parameters:
- aspectClass- the AspectJ aspect class
 
- 
getProxypublic <T> T getProxy()Create a new proxy according to the settings in this factory.Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors. Uses a default class loader: Usually, the thread context class loader (if necessary for proxy creation). - Returns:
- the new proxy
 
- 
getProxyCreate a new proxy according to the settings in this factory.Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors. Uses the given class loader (if necessary for proxy creation). - Parameters:
- classLoader- the class loader to create the proxy with
- Returns:
- the new proxy
 
 
-