Obtaining an interoperable object reference (IOR)

To locate a server object at run-time, the client application requires a reference to it. This reference is called an Interoperable Object Reference (IOR). An IOR is a text string encoded in a specific way, such that a client ORB can decode the IOR to locate the remote server object. It contains enough information to allow:

IORs may be returned by server methods, but a factory class is needed to create an initial IOR. CICS uses the CORBA LifeCycle Services' (CosLifeCycle) GenericFactory class for this purpose. A client application can use this GenericFactory to create IORs for each stateless CORBA object needed at runtime. However, the GenericFactory is itself a stateless CORBA object and thus the client application will need its IOR before it can create the target object's IOR.

Use the PERFORM CORBASERVER PUBLISH command to publish a stringified IOR for the GenericFactory class. The GenericFactory IOR is then created and stored on the shelf (an HFS directory associated with the CorbaServer), and published to the nameserver. The GenericFactory IOR can be used by the client application to create IORs for any stateless CORBA objects that exist for this CorbaServer (and only for this CorbaServer). The IOR is published with the name genfac.ior. How the client locates the GenericFactory IOR at runtime is an application architecture decision. The IOR could be retrieved from a well known location in a JNDI namespace, be kept locally on the client machine, or accessed by some other process.

You can use the CICS CEMT command ( see the CICS® Supplied Transactions manual ) to issue the PERFORM command, or you can issue EXEC CICS PERFORM ( see the CICS System Programming Reference manual ) from a CICS application.

The genfac.ior file is written to the CORBASERVER's shelf directory :
/shelf/applid/corbaserver/
where:
shelf
is the SHELF directory name specified in the CORBASERVER resource definition, defaulting to /var/cicsts/
applid
is the is the APPLID identifier associated with the CICS region
corbaserver
is the CORBASERVER resource name

You can download the IOR to your client workstation (in ASCII mode) from the shelf using FTP. Alternatively, your client can use the JNDI interface to obtain the IOR from the nameserver.

Due to the stateless nature of the object, there is seldom any point in a client creating more than one instance of a class. Once a client has created an instance of an object, for example bankaccountfacilitator, the same object can be used to access both Mr X's account and Mr Y's account; the account number is an input parameter in every method.
Note: We have called the object in this example a bankaccountfacilitator so that it can perform actions on any account. To have called it simply a bankaccount might imply that the instance always represented Mr X's account.