toolbox.services
Class ProxyFactory

Package class diagram package ProxyFactory
java.lang.Object
  extended by toolbox.services.ProxyFactory

public final class ProxyFactory
extends java.lang.Object

Static factory create java.lang.reflect.Proxy instances. The factory provides the mechanism behind the service interceptor functionality of the services package.


Method Summary
static java.lang.Object getProxyObject(java.lang.Object realObj, Interceptor[] interceptor)
          Return a Proxy instance that wraps the given Object instance for each of the provided Interceptor instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProxyObject

public static java.lang.Object getProxyObject(java.lang.Object realObj,
                                              Interceptor[] interceptor)
                                       throws ServiceException
Return a Proxy instance that wraps the given Object instance for each of the provided Interceptor instances.

Parameters:
realObj - Object instance that proxy must be created.
interceptor - Array of interceptor instances.
Returns:
Object that is the Proxy instance to use when interacting with the real Object instance.
Throws:
ServiceException - if the Object cannot be proxied.