org.apache.commons.proxy.factory.javassist
Class JavassistProxyFactory

java.lang.Object
  extended by org.apache.commons.proxy.ProxyFactory
      extended by org.apache.commons.proxy.factory.util.AbstractSubclassingProxyFactory
          extended by org.apache.commons.proxy.factory.javassist.JavassistProxyFactory

public class JavassistProxyFactory
extends AbstractSubclassingProxyFactory

A Javassist-based ProxyFactory implementation.

Dependencies:

Since:
1.0
Author:
James Carman

Constructor Summary
JavassistProxyFactory()
           
 
Method Summary
 Object createDelegatorProxy(ClassLoader classLoader, ObjectProvider targetProvider, Class[] proxyClasses)
          Creates a proxy which delegates to the object provided by delegateProvider.
 Object createInterceptorProxy(ClassLoader classLoader, Object target, Interceptor interceptor, Class[] proxyClasses)
          Creates a proxy which passes through a interceptor before eventually reaching the target object.
 Object createInvokerProxy(ClassLoader classLoader, Invoker invoker, Class[] proxyClasses)
          Creates a proxy which uses the provided Invoker to handle all method invocations.
 
Methods inherited from class org.apache.commons.proxy.factory.util.AbstractSubclassingProxyFactory
canProxy, getSuperclass, toInterfaces
 
Methods inherited from class org.apache.commons.proxy.ProxyFactory
createDelegatorProxy, createInterceptorProxy, createInvokerProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavassistProxyFactory

public JavassistProxyFactory()
Method Detail

createDelegatorProxy

public Object createDelegatorProxy(ClassLoader classLoader,
                                   ObjectProvider targetProvider,
                                   Class[] proxyClasses)
Description copied from class: ProxyFactory
Creates a proxy which delegates to the object provided by delegateProvider.

Overrides:
createDelegatorProxy in class ProxyFactory
Parameters:
classLoader - the class loader to use when generating the proxy
targetProvider - the delegate provider
proxyClasses - the interfaces that the proxy should implement
Returns:
a proxy which delegates to the object provided by the target delegateProvider>

createInterceptorProxy

public Object createInterceptorProxy(ClassLoader classLoader,
                                     Object target,
                                     Interceptor interceptor,
                                     Class[] proxyClasses)
Description copied from class: ProxyFactory
Creates a proxy which passes through a interceptor before eventually reaching the target object.

Overrides:
createInterceptorProxy in class ProxyFactory
Parameters:
classLoader - the class loader to use when generating the proxy
target - the target object
interceptor - the method interceptor
proxyClasses - the interfaces that the proxy should implement.
Returns:
a proxy which passes through a interceptor before eventually reaching the target object.

createInvokerProxy

public Object createInvokerProxy(ClassLoader classLoader,
                                 Invoker invoker,
                                 Class[] proxyClasses)
Description copied from class: ProxyFactory
Creates a proxy which uses the provided Invoker to handle all method invocations.

Overrides:
createInvokerProxy in class ProxyFactory
Parameters:
classLoader - the class loader to use when generating the proxy
invoker - the invoker
proxyClasses - the interfaces that the proxy should implement
Returns:
a proxy which uses the provided Invoker to handle all method invocations


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.