org.openejb.client.proxy
Class ProxyManager

java.lang.Object
  extended by org.openejb.client.proxy.ProxyManager

public class ProxyManager
extends Object

Since:
11/25/2001
Author:
David Blevins

Constructor Summary
ProxyManager()
           
 
Method Summary
static ClassLoader getContextClassLoader()
           
static ProxyFactory getDefaultFactory()
           
static String getDefaultFactoryName()
           
static InvocationHandler getInvocationHandler(Object proxy)
          Casts the object passed in to the appropriate proxy type and retreives the InvocationHandler assigned to it.
static Class getProxyClass(Class interfaceType)
          Loads and returns the proxy implementation for the specified interface.
static Class getProxyClass(Class[] interfaces)
           
static boolean isProxyClass(Class cl)
           
static Object newProxyInstance(Class proxyClass)
          Create a new proxy instance given a proxy class.
static Object newProxyInstance(Class[] interfaces, InvocationHandler h)
           
static Object newProxyInstance(Class interfaceType, InvocationHandler h)
          Throws a RuntimeException if there is a problem instantiating the new proxy instance.
static Object setInvocationHandler(Object proxy, InvocationHandler handler)
          Casts the object passed in to the appropriate proxy type and sets the InvocationHandler assigned to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyManager

public ProxyManager()
Method Detail

getDefaultFactory

public static ProxyFactory getDefaultFactory()

getDefaultFactoryName

public static String getDefaultFactoryName()

getInvocationHandler

public static InvocationHandler getInvocationHandler(Object proxy)
Casts the object passed in to the appropriate proxy type and retreives the InvocationHandler assigned to it. Executes on the default ProxyFactory instance.

Parameters:
proxy - The Proxy object to retreive the InvocationHandler from.
Returns:
The implementation of InvocationHandler handling invocations on the specified Proxy object.

setInvocationHandler

public static Object setInvocationHandler(Object proxy,
                                          InvocationHandler handler)
Casts the object passed in to the appropriate proxy type and sets the InvocationHandler assigned to it.

Parameters:
proxy - The Proxy object to retreive the InvocationHandler from.
Returns:
The Proxy object with the new InvocationHandler.

getProxyClass

public static Class getProxyClass(Class interfaceType)
                           throws IllegalAccessException
Loads and returns the proxy implementation for the specified interface.

Parameters:
interfaceType -
Returns:
Class
Throws:
IllegalAccessException

getProxyClass

public static Class getProxyClass(Class[] interfaces)
                           throws IllegalAccessException
Throws:
IllegalAccessException

newProxyInstance

public static Object newProxyInstance(Class interfaceType,
                                      InvocationHandler h)
                               throws IllegalAccessException
Throws a RuntimeException if there is a problem instantiating the new proxy instance.

Parameters:
interfaceType - A bean's home or remote interface that the Proxy object should implement.
h -
Returns:
Object
Throws:
IllegalAccessException

newProxyInstance

public static Object newProxyInstance(Class[] interfaces,
                                      InvocationHandler h)
                               throws IllegalAccessException
Throws:
IllegalAccessException

isProxyClass

public static boolean isProxyClass(Class cl)
Parameters:
cl -
Returns:
boolean

newProxyInstance

public static Object newProxyInstance(Class proxyClass)
                               throws IllegalAccessException
Create a new proxy instance given a proxy class.

Throws:
IllegalAccessException

getContextClassLoader

public static ClassLoader getContextClassLoader()


Copyright © 1999-2008 OpenEJB. All Rights Reserved.