com.compoundtheory.coldfusion.cfc
Class CFCDynamicProxy

java.lang.Object
  extended by com.compoundtheory.coldfusion.cfc.CFCDynamicProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class CFCDynamicProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

This is a dynamic proxy for ColdFusion components, for complete interoperability between CFCs and Java objects,. Creation of the Proxy is done through one of the several createInstance() methods.

Author:
Mark Mandel

Method Summary
static java.lang.Object createInstance(java.io.File path, java.lang.Class<?>[] interfaces)
          Create a proxy instance
static java.lang.Object createInstance(java.io.File path, java.lang.String[] interfaces)
          Create a proxy instance
static java.lang.Object createInstance(java.lang.String path, java.lang.Class<?>[] interfaces)
          Create a proxy instance
static java.lang.Object createInstance(java.lang.String path, java.util.List<java.lang.String> interfaces)
          Create a proxy instance
static java.lang.Object createInstance(java.lang.String path, java.lang.String[] interfaces)
          Create a proxy instance
static java.lang.Object createInstance(coldfusion.runtime.TemplateProxy cfc, java.lang.Class<?>[] interfaces)
          Create a proxy instance
static java.lang.Object createInstance(coldfusion.runtime.TemplateProxy cfc, java.util.List<java.lang.String> interfaces)
          Create a proxy instance
static java.lang.Object createInstance(coldfusion.runtime.TemplateProxy cfc, java.lang.String[] interfaces)
          Create a proxy instance
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static java.lang.Object createInstance(java.io.File path,
                                              java.lang.Class<?>[] interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
path - The File that points to the CFC
interfaces - the proxy will implement
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

createInstance

public static java.lang.Object createInstance(java.lang.String path,
                                              java.lang.Class<?>[] interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
path - Absolute path to the CFC we want to proxy
interfaces - the proxy will implement
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

createInstance

public static java.lang.Object createInstance(java.io.File path,
                                              java.lang.String[] interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
path - The File that points to the CFC
interfaces - An array of the names of the classes that this proxy will implement.
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

createInstance

public static java.lang.Object createInstance(java.lang.String path,
                                              java.lang.String[] interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
path - Absolute path to the CFC we want to proxy
interfaces - An array of the names of the classes that this proxy will implement.
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

createInstance

public static java.lang.Object createInstance(java.lang.String path,
                                              java.util.List<java.lang.String> interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
path - Absolute path to the CFC we want to proxy
interfaces - A List of the names of the classes that this proxy will implement.
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

createInstance

public static java.lang.Object createInstance(coldfusion.runtime.TemplateProxy cfc,
                                              java.lang.Class<?>[] interfaces)
Create a proxy instance

Parameters:
cfc - An actual CFC to pass in to the proxy.
interfaces - the proxy will implement
Returns:
the proxy that implements the interfaces given

createInstance

public static java.lang.Object createInstance(coldfusion.runtime.TemplateProxy cfc,
                                              java.lang.String[] interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
cfc - An actual CFC to pass in to the proxy.
interfaces - An array of the names of the classes that this proxy will implement.
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

createInstance

public static java.lang.Object createInstance(coldfusion.runtime.TemplateProxy cfc,
                                              java.util.List<java.lang.String> interfaces)
                                       throws java.lang.Throwable
Create a proxy instance

Parameters:
cfc - An actual CFC to pass in to the proxy.
interfaces - A List of the names of the classes that this proxy will implement.
Returns:
the proxy that implements the interfaces given
Throws:
java.lang.Throwable - if there is an error in the CFC

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable