A Caffeine Version of HelloWorld

Knowing the URL-Naming Service, the only new interface that Caffeine introduces, lets us jump right in and write some code. After all, Caffeine is just another way to develop CORBA code.

The Client

The client program consists of a single Java class: HelloWorldCaffeineClient (see Listing 21.1). This class provides a main method that performs the following functions: initializes the ORB; locates and then obtains a reference to a HelloWorld server object; invokes the getGreeting() method to get the greeting string; and displays the average Caffeinated Ping performance.

It is important to note that this example uses a URL-based naming scheme to locate a reference to the remote object.

Listing 21.1 HelloWorldCaffeineClient ...

Get JavaBeans Unleashed 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.