Writing the Server Code

This section introduces the basics of writing a CORBA transient server.

The structure of a CORBA server program is the same as most Java applications: You import required library packages, declare the server class, define a main() method, and remember to handle any exceptions.

Start your text editor and create a new file titled HelloServer.java. Next, important the packages required for the client class:

// The Package containing our stubs.
import HelloApp.*;
// HelloServer will use the naming service.
import org.omg.CosNaming.*;
// The package containing special exceptions
// thrown by the name service.
import org.omg.CORBA.*;

public class HelloServer
{
  // Add the main method here in the next step.
}

Declare a standard ...

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.