Adding CORBA Naming Service Support—Example 5

The fifth example adds support for the CORBA Naming Service to the application. Instead of the server passing object references to the client by writing to a file, the code is modified so that the server publishes object references to the naming service. The client can then retrieve object references from the naming service by resolving names.

No changes are made to the example IDL.

Client Code

Listing 2.32 and Listing 2.33 give the code for a client of the BookRepository::Collection interface in C++ and Java, respectively. This client obtains the Collection object reference using the CORBA Naming Service.

Listing 2.32. C++ Collection Client Using the CORBA Naming Service
//C++ #include <iostream.h> ...

Get Pure CORBA 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.