类 ProxyFactory
- 所有已实现的接口:
Advised,TargetClassAware,Serializable
- 从以下版本开始:
- 3.0
- 作者:
- Rod Johnson, Juergen Hoeller, Rob Harrop, TODAY 2021/2/1 22:58
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 infra.aop.framework.AdvisedSupport
AdvisedSupport.MethodCacheKey -
字段概要
字段从类继承的字段 infra.aop.framework.AdvisedSupport
advisorKey, EMPTY_TARGET_SOURCE, proxyMetadataCache, targetSource从类继承的字段 infra.aop.framework.ProxyConfig
exposeProxy, opaque -
构造器概要
构造器构造器说明Create a new ProxyFactory.ProxyFactory(Class<?>... proxyInterfaces) Create a new ProxyFactory.ProxyFactory(Class<?> proxyInterface, TargetSource targetSource) Create a ProxyFactory for the specifiedTargetSource, making the proxy implement the specified interface.ProxyFactory(Class<?> proxyInterface, Interceptor interceptor) Create a new ProxyFactory for the given interface and interceptor.ProxyFactory(Object target) Create a new ProxyFactory. -
方法概要
修饰符和类型方法说明getProxy()Create a new proxy according to the settings in this factory.static ObjectgetProxy(TargetSource targetSource) Create a proxy for the specifiedTargetSourcethat extends the target class of theTargetSource.static <T> TgetProxy(Class<T> proxyInterface, TargetSource targetSource) Create a proxy for the specifiedTargetSource, implementing the specified interface.static <T> TgetProxy(Class<T> proxyInterface, Interceptor interceptor) Create a new proxy for the given interface and interceptor.getProxy(ClassLoader classLoader) Create a new proxy according to the settings in this factory.Class<?>getProxyClass(ClassLoader classLoader) Determine the proxy class according to the settings in this factory.从类继承的方法 infra.aop.framework.ProxyCreatorSupport
addListener, adviceChanged, createAopProxy, getAopProxyFactory, isActive, removeListener, setAopProxyFactory从类继承的方法 infra.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisorInternal, addAdvisors, addAdvisors, addInterface, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, getAdvisorCount, getAdvisors, getAdvisorsInternal, getConfigurationOnlyCopy, getInterceptorChainFactory, getInterceptors, getProxiedInterfaces, getTargetClass, getTargetSource, hasUserSuppliedInterfaces, indexOf, indexOf, isInterfaceProxied, isPreFiltered, reduceToAdvisorKey, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, replaceAdvisor, setInterceptorChainFactory, setInterfaces, setPreFiltered, setTarget, setTargetClass, setTargetSource, toProxyConfigString, toString从类继承的方法 infra.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从接口继承的方法 infra.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
-
构造器详细资料
-
ProxyFactory
public ProxyFactory()Create a new ProxyFactory. -
ProxyFactory
Create a new ProxyFactory.Will proxy all interfaces that the given target implements.
- 参数:
target- the target object to be proxied
-
ProxyFactory
Create a new ProxyFactory.No target, only interfaces. Must add interceptors.
- 参数:
proxyInterfaces- the interfaces that the proxy should implement
-
ProxyFactory
Create a new ProxyFactory for the given interface and interceptor.Convenience method for creating a proxy for a single interceptor, assuming that the interceptor handles all calls itself rather than delegating to a target, like in the case of remoting proxies.
- 参数:
proxyInterface- the interface that the proxy should implementinterceptor- the interceptor that the proxy should invoke
-
ProxyFactory
Create a ProxyFactory for the specifiedTargetSource, making the proxy implement the specified interface.- 参数:
proxyInterface- the interface that the proxy should implementtargetSource- the TargetSource that the proxy should invoke
-
-
方法详细资料
-
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 proxy object
-
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 the given class loader (if necessary for proxy creation).
- 参数:
classLoader- the class loader to create the proxy with (ornullfor the low-level proxy facility's default)- 返回:
- the proxy object
-
getProxyClass
Determine the proxy class according to the settings in this factory.- 参数:
classLoader- the class loader to create the proxy class with (ornullfor the low-level proxy facility's default)- 返回:
- the proxy class
-
getProxy
Create a new proxy for the given interface and interceptor.Convenience method for creating a proxy for a single interceptor, assuming that the interceptor handles all calls itself rather than delegating to a target, like in the case of remoting proxies.
- 参数:
proxyInterface- the interface that the proxy should implementinterceptor- the interceptor that the proxy should invoke- 返回:
- the proxy object
- 另请参阅:
-
getProxy
Create a proxy for the specifiedTargetSource, implementing the specified interface.- 参数:
proxyInterface- the interface that the proxy should implementtargetSource- the TargetSource that the proxy should invoke- 返回:
- the proxy object
- 另请参阅:
-
getProxy
Create a proxy for the specifiedTargetSourcethat extends the target class of theTargetSource.- 参数:
targetSource- the TargetSource that the proxy should invoke- 返回:
- the proxy object
-