};
};
Step 3: Declaring the Operations
Each operation statement in the IDL generates a corresponding
method statement in the generated Java interface.
In your Hello.idl file, enter the operation statement:
module HelloApp
{
interface Hello
{
string sayHello();
};
};
2. Compile the remote interface
The tool idltojava reads OMG IDL files and
creates the required Java files
simply enter the tool name and the name of
your IDL file:
#idltojava Hello.idl
OR
#idlj -fall Hello.idl
You must use the -fall option with
the idlj compiler to generate both client and
server-side bindings.
The files generated by the idlj compiler for Hello.idl, with
the -fall command line option, are:
1. HelloPOA.java
This abstract class is the stream-based server skeleton,
providing basic CORBA functionality for the server.
3. Hello.java
This interface contains the Java version of our IDL interface.
try{
// create and initialize the ORB
ORB orb = ORB.init(args, null);