Back to Naming Service Examples Page
This example demonstrates how to:
bind
and rebind
operations
to bind CORBA Objects to a Context within the Naming Service.
resolve
operation to
retrieve CORBA Objects bound to the Naming Service
We illustrate the use of the OpenFusion Naming Service by considering a video-on-demand system. In a video-on-demand system we have a VideoServer that can provide video feeds (Video Machine) and a VideoClient (Television Set) that wishes to receive a video feed. The Naming Service can be used by the video feed provider to register its services. A client can then locate the video feed they are interested in by using the Naming Service.
This example demonstrates the simple use of the Naming Service to create a naming service graph, containing naming contexts and CORBA Objects, which can be accessed by CORBA Client Objects. This example is therefore split into two components:
The diagram below shows how the VideoServer (the Video Machine) and the VideoClient (the Television Set) interact with the OpenFusion Naming Service and each other.
This example uses the following source files: FilmImpl.java, VideoServer.java, VideoClient.java, and Video.idl.
First make sure the OpenFusion Naming Service is running on your network.
If using an ORB which requires persistent
POAs to be registered before they can be activated, ensure that the
OpenFusion.NamingVideoServer
POA is registered.
run -x com.prismt.cos.CosNaming.examples.Video.VideoServer
This should output "Entering
Server Loop...
" upon successful execution. The server now waits
for requests from Client objects (see below).
run -x com.prismt.cos.CosNaming.examples.Video.VideoClient
The program should terminate after it retrieves a film name and its certificate and description. These details should be printed to screen.
After running the example, expand the Naming Service tree node in the OpenFusion Administration Manager browser and choose the Naming Service Manager from the NameSingleton's pop-up menu by right-clicking on the node. You should be able to view the naming contexts and objects that have been bound into the Naming Service.