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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.