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:
To learn more about IBM ORB, you can refer to the following link:
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:
(2)initORB (for older probes, any relevant method that initialize the ORB)
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.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:
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:
Lastly, you can refer to some ORB initialization examples in the following website:
property.put(“ORBInitRef”, “NameService=corbaloc::” + host + “:” + port + “/NameService”);
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”));
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);
(1) CorbaUtils = an utility class
(2) getRootPOA() = a method that will return an initialized root POA
(3) client = a CORBA object
String name = "Add";
Add impl = AddHelper.narrow(ncRef.resolve_str(name));
(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:
To refer to more details about POA-Tie server side model, you can visit the following website:
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!