createDynamicProxy

creates a dynamic proxy of the ColdFusion component that is passed to a Java library. Dynamic proxy lets you pass ColdFusion components to Java objects. Java objects can work with the ColdFusion components seamlessly as if they are native Java objects.

createDynamicProxy("fullyQualifiedNameOfCFC", ["interfaceName"]); → returns Meta data structure related to the current session

createDynamicProxy Argument Reference

fullyQualifiedNameOfCFC
Required

Fully qualified name of the ColdFusion component or a CFC instance.

interfaceName

An array of Java interfaces for which you want to create the dynamic proxy.

Examples sample code invoking the createDynamicProxy function


Tag Syntax

<cfset instance=new cfc.helloWorld()> 
 <cfset dynInstnace = createDynamicProxy(instance, ["MyInterface"])> 
 <cfset x = createObject("java","InvokeHelloProxy").init(dynInstnace)> 
 <cfset y = x.invokeHello()> 
 <cfoutput>#y#</cfoutput> 

Fork me on GitHub