Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » aop » framework » [javadoc | source]
org.springframework.aop.framework
public class: ProxyFactory [javadoc | source]
java.lang.Object
   org.springframework.aop.framework.ProxyConfig
      org.springframework.aop.framework.AdvisedSupport
         org.springframework.aop.framework.ProxyCreatorSupport
            org.springframework.aop.framework.ProxyFactory

All Implemented Interfaces:
    AopProxy, Advised, Serializable

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.
Fields inherited from org.springframework.aop.framework.AdvisedSupport:
EMPTY_TARGET_SOURCE,  targetSource,  advisorChainFactory
Fields inherited from org.springframework.aop.framework.ProxyConfig:
opaque,  exposeProxy
Constructor:
 public ProxyFactory() 
 public ProxyFactory(Object target) 
    Create a new ProxyFactory.

    Will proxy all interfaces that the given target implements.

    Parameters:
    target - the target object to be proxied
 public ProxyFactory(Class[] proxyInterfaces) 
    Create a new ProxyFactory.

    No target, only interfaces. Must add interceptors.

    Parameters:
    proxyInterfaces - the interfaces that the proxy should implement
 public ProxyFactory(Class proxyInterface,
    Interceptor interceptor) 
    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.

    Parameters:
    proxyInterface - the interface that the proxy should implement
    interceptor - the interceptor that the proxy should invoke
 public ProxyFactory(Class proxyInterface,
    TargetSource targetSource) 
    Create a ProxyFactory for the specified TargetSource, making the proxy implement the specified interface.
    Parameters:
    proxyInterface - the interface that the proxy should implement
    targetSource - the TargetSource that the proxy should invoke
Method from org.springframework.aop.framework.ProxyFactory Summary:
getProxy,   getProxy,   getProxy,   getProxy,   getProxy
Methods from org.springframework.aop.framework.ProxyCreatorSupport:
addListener,   adviceChanged,   createAopProxy,   getAopProxyFactory,   isActive,   removeListener,   setAopProxyFactory
Methods from org.springframework.aop.framework.AdvisedSupport:
addAdvice,   addAdvice,   addAdvisor,   addAdvisor,   addAllAdvisors,   addInterface,   adviceChanged,   adviceIncluded,   copyConfigurationFrom,   copyConfigurationFrom,   countAdvicesOfType,   getAdvisorChainFactory,   getAdvisors,   getAdvisorsInternal,   getConfigurationOnlyCopy,   getInterceptorsAndDynamicInterceptionAdvice,   getProxiedInterfaces,   getTargetClass,   getTargetSource,   indexOf,   indexOf,   isInterfaceProxied,   isPreFiltered,   removeAdvice,   removeAdvisor,   removeAdvisor,   removeInterface,   replaceAdvisor,   setAdvisorChainFactory,   setInterfaces,   setPreFiltered,   setTarget,   setTargetClass,   setTargetSource,   toProxyConfigString,   toString,   updateAdvisorArray
Methods from org.springframework.aop.framework.ProxyConfig:
copyFrom,   isExposeProxy,   isFrozen,   isOpaque,   isOptimize,   isProxyTargetClass,   setExposeProxy,   setFrozen,   setOpaque,   setOptimize,   setProxyTargetClass,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.aop.framework.ProxyFactory Detail:
 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.

    Uses a default class loader: Usually, the thread context class loader (if necessary for proxy creation).

 public Object 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).

 public static Object getProxy(TargetSource targetSource) 
    Create a proxy for the specified TargetSource that extends the target class of the TargetSource.
 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.

 public static Object getProxy(Class proxyInterface,
    TargetSource targetSource) 
    Create a proxy for the specified TargetSource, implementing the specified interface.