类 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
- 所有已实现的接口:
Serializable
,Advised
,TargetClassAware
public class AspectJProxyFactory extends ProxyCreatorSupport
AspectJ-based proxy factory, allowing for programmatic building of proxies which include AspectJ aspects (code style as well Java 5 annotation style).- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller, Ramnivas Laddad
- 另请参阅:
addAspect(Object)
,addAspect(Class)
,getProxy()
,getProxy(ClassLoader)
,ProxyFactory
, 序列化表格
字段概要
从类继承的字段 org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCE
构造器概要
构造器 构造器 说明 AspectJProxyFactory()
Create a new AspectJProxyFactory.AspectJProxyFactory(Class<?>... interfaces)
Create a newAspectJProxyFactory
.AspectJProxyFactory(Object target)
Create a new AspectJProxyFactory.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addAspect(Class<?> aspectClass)
Add an aspect of the supplied type to the end of the advice chain.void
addAspect(Object aspectInstance)
Add the supplied aspect instance to the chain.<T> T
getProxy()
Create a new proxy according to the settings in this factory.<T> T
getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory.从类继承的方法 org.springframework.aop.framework.ProxyCreatorSupport
addListener, adviceChanged, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactory
从类继承的方法 org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisors, addAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getInterceptorsAndDynamicInterceptionAdvice, getProxiedInterfaces, getTargetClass, getTargetSource, indexOf, indexOf, isInterfaceProxied, isPreFiltered, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toString, updateAdvisorArray
从类继承的方法 org.springframework.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy
构造器详细资料
AspectJProxyFactory
public AspectJProxyFactory()
Create a new AspectJProxyFactory.
AspectJProxyFactory
public AspectJProxyFactory(Object target)
Create a new AspectJProxyFactory.Will proxy all interfaces that the given target implements.
- 参数:
target
- the target object to be proxied
AspectJProxyFactory
public AspectJProxyFactory(Class<?>... interfaces)
Create a newAspectJProxyFactory
. No target, only interfaces. Must add interceptors.
方法详细资料
addAspect
public void addAspect(Object aspectInstance)
Add 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.- 参数:
aspectInstance
- the AspectJ aspect instance
addAspect
public void addAspect(Class<?> aspectClass)
Add an aspect of the supplied type to the end of the advice chain.- 参数:
aspectClass
- the AspectJ aspect class
getProxy
public <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).
- 返回:
- the new proxy
getProxy
public <T> T getProxy(ClassLoader classLoader)
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 the given class loader (if necessary for proxy creation).
- 参数:
classLoader
- the class loader to create the proxy with- 返回:
- the new proxy