IBM Support

Migrating Omnibus Probes to IBM ORB

Technical Blog Post


Abstract

Migrating Omnibus Probes to IBM ORB

Body

 

Omnibus CORBA probes used to use Visibroker as its ORB. However, moving forward, we will be migrating the probes to IBM ORB.

 

If you are new to CORBA and would like to learn more about it (in JAVA), let me recommend the following websites:
http://www.omg.org/gettingstarted/corbafaq.htm
http://java.sun.com/developer/onlineTraining/corba/corba.html
http://docs.oracle.com/javase/1.4.2/docs/guide/idl/jidlExample.html

 

To learn more about IBM ORB, you can refer to the following link:
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.60%2Fdiag%2Funderstanding%2Forb.html

 

For the IBM ORB migration, there are a few general steps to follow.


 

Step 1 – Compiling IDL

Since the source code is in Java, use “idlj” to compile the IDLs. To learn more about idlj, all you need to do is to execute the command without any option and the usage information will be echoed.

 

One of the requirements for the migration is to migrate the codes from the ImplBase (BOA) model to the POA model. Hence, it is recommended to use the -fallTIE option, so that the appropriate bindings will be produced.

 

Beside that, if you would like to give a more proper package name to the IDLs, you can include the -pkgPrefix <t> <prefix> option. For example, the following command will produce the org.CosNaming.* package:

idlj -fallTIE -pkgPrefix CosNaming org CosNaming.idl

 

Please remember to compile the produced source files using javac.

 


Step 2 – Introduce New Properties
As one of the requirements for the migration, you have to introduce the following properties:
(1) com.ibm.CORBA.ORBCharEncoding (mapped to ORBWCharEncoding property of the probe)
(2) com.ibm.CORBA.ORBCharDefault (mapped to ORBWCharDefault property of the probe)

 

By default, IBM ORB will use the following values:
com.ibm.CORBA.ORBWCharDefault = UCS2
com.ibm.CORBA.ORBCharEncoding = ISO8859_1

 

The values for the above properties are probe dependent, so please refer to the relevant documentation for more details.

 

Beside the new char encoding properties, all Omnibus CORBA probes should now support the ORBLocalHost and ORBLocalPort properties.

 

The new properties should be added to the following methods:
(1)<probename>.CreateProperties()
(2)initORB (for older probes, any relevant method that initialize the ORB)

 

Eg.
context.propCreate(“ORBLocalHost”);
context.propSetValue(“ORBLocalHost”, “”);
context.propArgDefine(“-orblocalhost”, “ORBLocalHost”, “The local host used by the server-side ORB to place the server's host name or IP address into the IOR of a remote object”);

 

context.propCreateInt(“ORBLocalPort”);
context.propSetValueInt(“ORBLocalPort”, -1);
context.propArgDefineInt(“-orblocalport”, “ORBLocalPort”, “The local port number for the ORB to listen on (Default=0, ORB will choose random port)”);

 


Step 3 – Initialize IBM ORB
A few important properties have to be associated to the ORB before it is initialized:
(1) org.omg.CORBA.ORBClass
(2) org.omg.CORBA.ORBSingletonClass
(3) org.ibm.CORBA.ORBInitRef.NameService
(4) org.ibm.CORBA.ORBInitRef.NameServiceServerRoot

 

For “org.omg.CORBA.ORBClass”, it should be set to “com.ibm.CORBA.iiop.ORB”.
For “org.omg.CORBA.ORBSingletonClass”, it should be set to “com.ibm.rmi.corba.ORBSingleton”.

 

For “org.ibm.CORBA.ORBInitRef.NameService” and “org.ibm.CORBA.ORBInitRef.NameServiceServerRoot” properties, they can be set using the common corbaloc or corbaname URLs.

 

For more information about corbaloc and corbaname, you can refer to the following websites:
http://publib.boulder.ibm.com/infocenter/adiehelp/v5r1m1/index.jsp?topic=%2Fcom.ibm.wasee.doc%2Finfo%2Fee%2Fcorba%2Fconcepts%2Fccor_ipgmc8a.html
http://publib.boulder.ibm.com/infocenter/adiehelp/v5r1m1/index.jsp?topic=%2Fcom.ibm.wasee.doc%2Finfo%2Fee%2Fcorba%2Fconcepts%2Fccor_ipgmc8b.html

 

Lastly, you can refer to some ORB initialization examples in the following website:
http://publib.boulder.ibm.com/infocenter/wasinfo/fep/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Frnam_example_corba1.html

 

Eg.
FROM:
property.put(“org.omg.CORBA.ORBClass”, “com.inprise.vbroker.orb.ORB”);
property.put(“org.omg.CORBA.ORBSingletonClass”, “com.inprise.vbroker.orb.ORB”);
property.put(“ORBInitRef”, “NameService=corbaloc::” + host + “:” + port + “/NameService”);

 

TO:
property.put(“org.omg.CORBA.ORBClass”, “com.ibm.CORBA.iiop.ORB”);
property.put(“org.omg.CORBA.ORBSingletonClass”, “com.ibm.rmi.corba.ORBSingleton”);
property.put(“org.ibm.CORBA.ORBInitRef.NameService”, “corbaloc::iiop:” + host + “:” + port + “/NameService”);
property.put(“org.ibm.CORBA.ORBInitRef.NameServiceServerRoot”, “corbaloc::iiop:” + host + “:” + port + “/NameServiceServerRoot”);

 


Step 4 – POA model
Migrating the codes from the ImplBase model to POA model involves implementing different classes and using different set of APIs.

 

One of the most vital tasks to using the POA model is to get a reference to the root POA and activate the POAManager. You can do so easily with the following codes:

POA rootpoa = POAHelper.narrow(orb.resolve_initial_references(“RootPOA”));
rootpoa.the_POAManager().activate();

There are several ways to obtain an object reference in a POA model, you can consider the following codes:

org.omg.CORBA.Object ref = CorbaUtils.getRootPOA().servant_to_reference(client);

where
(1) CorbaUtils = an utility class
(2) getRootPOA() = a method that will return an initialized root POA
(3) client = a CORBA object

 

OR

String name = "Add";
Add impl = AddHelper.narrow(ncRef.resolve_str(name));

where
(1) AddHelper = the helper class of the CORBA object
(2) ncRef = a reference to a NamingContextExt instance
(3) name = the name given to the CORBA object (in this example, it's “Add”);

 

For an example of how to code in POA model, you can refer to the example available at:
http://docs.oracle.com/javase/1.4.2/docs/guide/idl/jidlExample.html

To refer to more details about POA-Tie server side model, you can visit the following website:
http://docs.oracle.com/javase/1.4.2/docs/guide/idl/jidlTieServer.html

 


Step 5 –  Package
Probes are shipped in the JAR format. It is recommended to include all the compiled IDLs and source classes in the JAR. To do that, you can execute the following command:

jar cvf <probaname>.jar <all the related classes>

 

 

Those are the general steps needed for the migration. Have fun learning CORBA and IBM ORB!

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"","label":""},"Component":"","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm11082001