4
votes

I'm just starting working with CORBA. Basically, I'm having to implement a Java application that acts as a CORBA client.

At this point, I'm mainly using the Sun JDK (JDK6) tools, including idlj.exe (to compile the IDL that I was given) and orbd.exe (for testing my code), and so far, I've been able to use the idlj and the IDL to create the Java classes, and I also wrote a test server app and test client app that are both now working (I had to write the small server app so that I could test my client app).

As I said above, I'm using orbd.exe as the ORB for my testing.

Initially, I had orbd.exe, my Java server app, and my Java client app, all running on the same machine, and that worked.

I've also tested in a more distributed configuration, where I ran orbd.exe and my Java server app on another machine (testxp), and my Java client app on a separate machine, and that works.

My question is as follows: A lot of the documents, web pages, etc. that I've seen re. CORBA have diagrams showing two ORBs, e.g., a server app and an ORB on one machine, and a client app and another/2nd ORB running on another/2nd machine, with the two ORBs communicating with each other:

client app ==> ORB1 ----> ORB2 ==> server app

whereas, in my testing so far, using orbd.exe as the ORB, I only have been using one ORB.

So, I was wondering how can I configure a test configuration where there are two ORBs as described above?

Can I do that using orbd.exe, or does orbd.exe not work in that type of configuration?

Also, if that can be done using orbd.exe, how do I do that?

Thanks, Jim

1

1 Answers

1
votes

CORBA is an architecture and infrastructure to communicate application in a network. And ORB is the component that serialize (marshal) and deserialize (unmarshal) the calls to IIOP. With CORBA, you can write a code in C# (using IIOP.NET) and communicate with a server in Java.

So, you are right, the communication is made between ORBs.

|client app| <==> ORB1 <--(IIOP)--> ORB2 <==> |server app|

ORBD is an ORB with a Naming Server. It is ideal that you have only one Name Service, you can read about name service here.

Finally, you have many ways to start comunication between ORBs. (a) activate servant in the POA and call method *poa.object_to_string(servant)*, write the string in a file then read it in the client using *poa.string_to_object(fileAsString)*. (b) define server host and port and use corbaloc. (c) subscribe in a name server (best option).

Try to use three process in your test. Name Server, Client, Server.

PS: I like JacORB then JDK Orb

EDIT: Adding some code to help:

orb = org.omg.CORBA.ORB.init(args, props);
org.omg.CORBA.Object obj = this.orb.resolve_initial_references("RootPOA");
this.rootPOA = POAHelper.narrow(obj);
POAManager manager = this.rootPOA.the_POAManager();
manager.activate();