org.openejb.client.proxy
Class ProxyManager

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

public class ProxyManager
extends java.lang.Object

Since:
11/25/2001
Author:
David Blevins

Constructor Summary
ProxyManager()
           
 
Method Summary
static java.lang.ClassLoader getContextClassLoader()
           
static ProxyFactory getDefaultFactory()
           
static java.lang.String getDefaultFactoryName()
           
static InvocationHandler getInvocationHandler(java.lang.Object proxy)
          Casts the object passed in to the appropriate proxy type and retreives the InvocationHandler assigned to it.
static java.lang.Class getProxyClass(java.lang.Class interfaceType)
          Loads and returns the proxy implementation for the specified interface.
static java.lang.Class getProxyClass(java.lang.Class[] interfaces)
           
static boolean isProxyClass(java.lang.Class cl)
           
static java.lang.Object newProxyInstance(java.lang.Class proxyClass)
          Create a new proxy instance given a proxy class.
static java.lang.Object newProxyInstance(java.lang.Class[] interfaces, InvocationHandler h)
           
static java.lang.Object newProxyInstance(java.lang.Class interfaceType, InvocationHandler h)
          Throws a RuntimeException if there is a problem instantiating the new proxy instance.
static java.lang.Object setInvocationHandler(java.lang.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 java.lang.String getDefaultFactoryName()

getInvocationHandler

public static InvocationHandler getInvocationHandler(java.lang.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 java.lang.Object setInvocationHandler(java.lang.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 java.lang.Class getProxyClass(java.lang.Class interfaceType)
                                     throws java.lang.IllegalAccessException
Loads and returns the proxy implementation for the specified interface.

Parameters:
interfaceType -
Returns:
Class
Throws:
java.lang.IllegalAccessException

getProxyClass

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

newProxyInstance

public static java.lang.Object newProxyInstance(java.lang.Class interfaceType,
                                                InvocationHandler h)
                                         throws java.lang.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:
java.lang.IllegalAccessException

newProxyInstance

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

isProxyClass

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

newProxyInstance

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

Throws:
java.lang.IllegalAccessException

getContextClassLoader

public static java.lang.ClassLoader getContextClassLoader()


Copyright © 1999-2011 OpenEJB. All Rights Reserved.