|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.framework.ProxyConfig org.springframework.aop.framework.AdvisedSupport org.springframework.aop.framework.ProxyFactory
public class ProxyFactory
Factory for AOP proxies for programmatic use, rather than via a bean factory. This class provides a simple way of obtaining and configuring AOP proxies in code.
Field Summary |
---|
Fields inherited from class org.springframework.aop.framework.AdvisedSupport |
---|
advisorChainFactory, EMPTY_TARGET_SOURCE, targetSource |
Fields inherited from class org.springframework.aop.framework.ProxyConfig |
---|
exposeProxy, logger |
Constructor Summary | |
---|---|
ProxyFactory()
Create a new ProxyFactory. |
|
ProxyFactory(Class[] interfaces)
Create a new ProxyFactory. |
|
ProxyFactory(Object target)
Create a new ProxyFactory. |
Method Summary | |
---|---|
Object |
getProxy()
Create a new proxy according to the settings in this factory. |
static Object |
getProxy(Class proxyInterface,
Interceptor interceptor)
Create a new proxy for the given interface and interceptor. |
Object |
getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory. |
static Object |
getProxy(Class proxyInterface,
TargetSource targetSource)
Create a proxy for the specified TargetSource that implements the
specified interface. |
static Object |
getProxy(TargetSource targetSource)
Create a proxy for the specified TargetSource that extends the
target class of the TargetSource . |
Methods inherited from class org.springframework.aop.framework.AdvisedSupport |
---|
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisor, addAllAdvisors, addInterface, addListener, adviceChanged, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, createAopProxy, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getProxiedInterfaces, getTargetSource, indexOf, indexOf, isActive, isInterfaceProxied, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, removeListener, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setTarget, setTargetSource, toProxyConfigString, toString, updateAdvisorArray, writeReplace |
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
---|
copyFrom, getAopProxyFactory, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setAopProxyFactory, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.aop.framework.Advised |
---|
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy |
Constructor Detail |
---|
public ProxyFactory()
public ProxyFactory(Object target) throws AopConfigException
Will proxy all interfaces of the given target.
target
- the target object that is to be proxied
AopConfigException
- if the supplied target object is null
public ProxyFactory(Class[] interfaces)
Method Detail |
---|
public Object getProxy()
Uses a default class loader: Usually, the thread context class loader (if necessary for proxy creation).
getProxy
in interface AopProxy
Thread.getContextClassLoader()
public Object getProxy(ClassLoader classLoader)
Uses the given class loader (if necessary for proxy creation).
getProxy
in interface AopProxy
classLoader
- the class loader to create the proxy with
public static Object getProxy(Class proxyInterface, Interceptor 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
public static Object getProxy(Class proxyInterface, TargetSource targetSource)
TargetSource
that implements the
specified interface.
public static Object getProxy(TargetSource targetSource)
TargetSource
that extends the
target class of the TargetSource
.
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |