Creating CORBA objects



In ColdFusion, the cfobject tag and CreateObject function create a stub, or proxy object, for the CORBA object on the remote server. You use this stub object to invoke the remote object.

The following table describes the attributes you use in the cfobject tag to create a CORBA object:

Attribute

Description

type

Must be CORBA. COM is the default.

context

Specifies the CORBA binding method, that is, how the object is obtained, as follows:

  • IOR Uses a file containing the object's unique Interoperable Object Reference.

  • NameService Uses a naming service.

class

Specifies the information required for the binding method to access the object.

If you set the context attribute to IOR, The class attribute must be to the full path of a file containing the string version of the IOR. ColdFusion must be able to read this IOR file at all times, so make it local to the server or locate it on the network in an accessible place.

If you set the context attribute to NameService, The class attribute must be a name delimited by forward slashes (/), such as MyCompany/Department/Dev. You can use period-delimited “kind” identifiers as part of the class attribute; for example, adobe.current/Eng.current/CF"

name

Specifies the name (handle) that your application uses to call the object's interface.

locale

(Optional) Identifies the connector configuration. You can omit this option if ColdFusion Administrator has only one connector configuration, or if it has multiple connector configurations and you want to use the one that is currently selected in the Administrator. If you specify this attribute, it must be an ORB name you specified in the CORBA Connector ORB Name field when you configured a CORBA connector in ColdFusion Administrator; for example, Visibroker.

For example, use the following CFML to invoke a CORBA object specified by the tester.ior file if you configured your ORB name as Visibroker:

<cfobject action = "create" type = "CORBA" context = "IOR"  
    class = "d:\temp\tester.ior" name = "handle" locale = "Visibroker">

When you use the CreateObject function to invoke this CORBA object, specify the name as the function return variable, and specify the type, class, context, and locale as arguments. For example, the following line creates the same object as the preceding cfobject tag:

handle = CreateObject("CORBA", "d:\temp\tester.ior", "IOR", "Visibroker")

Using a naming service

Currently, ColdFusion can only resolve objects registered in a CORBA 2.3-compliant naming service.

If you use a naming service, make sure that its naming context is identical to the naming context specified in the property file of the Connector configuration in use, as specified in the ColdFusion Administrator CORBA Connectors page. The property file must contain the line "SVCnameroot=name" where name is the naming context being used. The server implementing the object must bind to this context, and register the appropriate name.