org.springframework.aop.framework
Class ProxyFactory
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AdvisedSupport
org.springframework.aop.framework.ProxyFactory
- All Implemented Interfaces:
- Serializable, Advised
public class ProxyFactory
- extends AdvisedSupport
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.
- Since:
- 14.03.2003
- Author:
- Rod Johnson
- See Also:
- Serialized Form
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. |
Methods inherited from class org.springframework.aop.framework.AdvisedSupport |
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisor, addInterface, addListener, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, createAopProxy, getAdvisorChainFactory, getAdvisors, getProxiedInterfaces, getTargetSource, indexOf, indexOf, isActive, isInterfaceProxied, readResolve, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, removeListener, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setTarget, setTargetSource, toProxyConfigString, toString, writeReplace |
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
copyFrom, getAopProxyFactory, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setAopProxyFactory, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass |
ProxyFactory
public ProxyFactory()
- Create a new ProxyFactory.
ProxyFactory
public ProxyFactory(Object target)
throws AopConfigException
- Create a new ProxyFactory.
Proxy all interfaces of the given target.
- Throws:
AopConfigException
ProxyFactory
public ProxyFactory(Class[] interfaces)
- Create a new ProxyFactory.
No target, only interfaces. Must add interceptors.
getProxy
public 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.
- Returns:
- the new proxy
getProxy
public static Object getProxy(Class proxyInterface,
Interceptor interceptor)
- 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.
- Parameters:
proxyInterface
- the interface that the proxy should implementinterceptor
- the interceptor that the proxy should invoke
- Returns:
- the new proxy
Copyright (c) 2002-2005 The Spring Framework Project.