Description of the example
This example illustrates the basic tasks in building a CORBA distributed application using Java IDL. You will build the classic Hello World program as a distributed application. The Hello World program has a single operation that returns a string to be printed.
1.The client invokes the sayHello method of the HelloServer.
2.The ORB transfers that invocation to the servant object registered for that IDL interface.
3.The servant's sayHello method runs, returning a Java String.
4.The ORB transfers that String back to the client.
5.The client prints the value of the String.
Getting started
You will need two things: version 1.2 of the JDK software and the idltojava compiler. The JDK provides the API and ORB needed to enable CORBA-based distributed object interaction. The idltojava compiler uses the IDL-to-Java mapping to convert IDL interface definitions to corresponding Java interfaces, classes, and methods, which you can then use to implement your client and server code.
Writing the IDL Interface
In this section, you will write a simple IDL interface for the Hello World program. The IDL interface defines the contract between the client and server parts of your application, specifying what operations and attributes are available. OMG IDL is programming-language independent. You must map it to Java before writing any of the implementation code. (Running idltojava on the IDL file does this for you automatically.) Here's the complete Hello.idl file:
module HelloApp
{
interface Hello { string sayHello(); };
};
OMG IDL is a purely declarative language designed for specifying programming-language-independent operational interfaces for distributed applications. OMG specifies a mapping from IDL to several different programming languages, including C, C++, Smalltalk, COBOL, Ada, and Java. When mapped, each statement in OMG IDL is translated to a corresponding statement