org.openejb.client.proxy
Interface ProxyFactory

All Known Implementing Classes:
Jdk13ProxyFactory

public interface ProxyFactory

Allows us to implement different versions of Proxies

Since:
11/25/2001
Author:
David Blevins

Method Summary
 InvocationHandler getInvocationHandler(java.lang.Object proxy)
          Returns the invocation handler for the specified proxy instance.
 java.lang.Class getProxyClass(java.lang.Class interfce)
          Returns the java.lang.Class object for a proxy class given a class loader and an array of interfaces.
 java.lang.Class getProxyClass(java.lang.Class[] interfaces)
          Returns the java.lang.Class object for a proxy class given a class loader and an array of interfaces.
 void init(java.util.Properties props)
          Prepares the ProxyFactory for use.
 boolean isProxyClass(java.lang.Class cl)
          Returns true if and only if the specified class was dynamically generated to be a proxy class using the getProxyClass method or the newProxyInstance method.
 java.lang.Object newProxyInstance(java.lang.Class proxyClass)
          Returns a new proxy instance from the specified proxy class.
 java.lang.Object newProxyInstance(java.lang.Class[] interfaces, InvocationHandler h)
          Returns an instance of a proxy class for the specified interface that dispatches method invocations to the specified invocation handler.
 java.lang.Object newProxyInstance(java.lang.Class interfce, InvocationHandler h)
          Returns an instance of a proxy class for the specified interface that dispatches method invocations to the specified invocation handler.
 java.lang.Object setInvocationHandler(java.lang.Object proxy, InvocationHandler handler)
          Sets the invocation handler for the specified proxy instance.
 

Method Detail

init

void init(java.util.Properties props)
Prepares the ProxyFactory for use. Called once right after the ProxyFactory is instantiated.

Parameters:
props -

getInvocationHandler

InvocationHandler getInvocationHandler(java.lang.Object proxy)
                                       throws java.lang.IllegalArgumentException
Returns the invocation handler for the specified proxy instance.

Throws:
java.lang.IllegalArgumentException

setInvocationHandler

java.lang.Object setInvocationHandler(java.lang.Object proxy,
                                      InvocationHandler handler)
                                      throws java.lang.IllegalArgumentException
Sets the invocation handler for the specified proxy instance.

Throws:
java.lang.IllegalArgumentException

getProxyClass

java.lang.Class getProxyClass(java.lang.Class interfce)
                              throws java.lang.IllegalArgumentException
Returns the java.lang.Class object for a proxy class given a class loader and an array of interfaces.

Parameters:
interfce -
Returns:
Class
Throws:
java.lang.IllegalArgumentException

getProxyClass

java.lang.Class getProxyClass(java.lang.Class[] interfaces)
                              throws java.lang.IllegalArgumentException
Returns the java.lang.Class object for a proxy class given a class loader and an array of interfaces.

Parameters:
interfaces -
Returns:
Class
Throws:
java.lang.IllegalArgumentException

isProxyClass

boolean isProxyClass(java.lang.Class cl)
Returns true if and only if the specified class was dynamically generated to be a proxy class using the getProxyClass method or the newProxyInstance method.

Parameters:
cl -
Returns:
boolean

newProxyInstance

java.lang.Object newProxyInstance(java.lang.Class interfce,
                                  InvocationHandler h)
                                  throws java.lang.IllegalArgumentException
Returns an instance of a proxy class for the specified interface that dispatches method invocations to the specified invocation handler.

Parameters:
interfce -
h -
Returns:
Object
Throws:
java.lang.IllegalArgumentException

newProxyInstance

java.lang.Object newProxyInstance(java.lang.Class[] interfaces,
                                  InvocationHandler h)
                                  throws java.lang.IllegalArgumentException
Returns an instance of a proxy class for the specified interface that dispatches method invocations to the specified invocation handler.

Parameters:
interfaces -
h -
Returns:
Object
Throws:
java.lang.IllegalArgumentException

newProxyInstance

java.lang.Object newProxyInstance(java.lang.Class proxyClass)
                                  throws java.lang.IllegalArgumentException
Returns a new proxy instance from the specified proxy class. The interface(s) implemented by the proxy instance are determined by the proxy class. The class name may or may not be meaningful, depending on the implementation.

Parameters:
proxyClass -
Returns:
Object
Throws:
java.lang.IllegalArgumentException - Occurs when the specified class is not a proxy class.
java.lang.IllegalArgumentException


Copyright © 1999-2011 OpenEJB. All Rights Reserved.