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(cfc, interfaces) → returns any

Argument Reference

cfc any

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

interfaces array

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

Sample code invoking the createDynamicProxy function

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

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub