Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1160

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
<assemblyList>
<assembly file="path to assembly or fully qualified name"/>
...
</assemblyList>
Stop and restart the .NET-side agent, if it is running. For example, on a ColdFusion system, restart the ColdFusion
3
.NET Service. Your ColdFusion application can now access the .NET classes that you configured.
The following example is a bare-bones JNBDotNetSide.exe.config file that specifies a .NET-side TCP server
configuration. The server communicates by using TCP binary mode and listens on port 6086. Java clients can access \\x
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<sectionGroup name="jnbridge">
<section name="dotNetToJavaConfig"
type="System.Configuration.SingleTagSectionHandler"/>
<section name="javaToDotNetConfig"
type="System.Configuration.SingleTagSectionHandler"/>
<section name="tcpNoDelay"
type="System.Configuration.SingleTagSectionHandler"/>
<section name="javaSideDeclarations"
type="System.Configuration.NameValueSectionHandler"/>
<section name="assemblyList"
type="com.jnbridge.jnbcore.AssemblyListHandler, JNBShare"/>
</sectionGroup>
<jnbridge>
<javaToDotNetConfig scheme="jtcp" port="6086"/>
<assemblyList>
\\x
<assembly file="System.Windows.Forms, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</assemblyList>
</jnbridge>
</configuration>
Using .NET classes
You use .NET assembly classes the same way you use Java and other objects that you create using the cfobject tag or
CreateObject function. In the simplest case, your application code only has to use the following format to include a
local .NET class method:
<cfobject type = ".NET" name = "mathInstance" class = "mathClass"
assembly = "C:/Net/Assemblies/math.dll">
<cfset myVar = mathInstance.multiply(1,2)>
Using CFScript and the
CreateObject
<cfscript>
mathInstance = CreateObject(".NET", "mathClass",
"C:/Net/Assemblies/math.dll");
myVar = mathInstance.multiply(1,2);
</cfscript>
Note: You cannot load two DLLs with same fully qualified name. ColdFusion always uses the first DLL that it accesses
until the server is restarted. For example, if page1.cfm uses c:\dev\a.dll and page2.cfm uses c:\dev2\a.dll, and both DLLs
have the same fully qualified name, the first DLL file to be loaded remains loaded, and both CFML pages use it.
function, you can do the following:
Last updated 1/20/2012
1155

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents