Creating a CORBA Client

Creating a CORBA client program is much easier than creating a server. You use the same procedure to initialize the ORB in the client as you do in the server. Once again, you must set system properties to specify different ORB implementation classes if you use an ORB other than the one built into the JDK. You also locate the naming service the same way in the client as you do in the server.

After you locate the naming service, use the resolve method to locate the CORBA object. Resolve takes an array of NameComponent objects just like you use in the rebind method. After you locate the object, use the narrow method to cast the Object reference to the type you want.

Listing 17.3 shows the MOTDClient program that interacts ...

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.