The CORBA module provides a CORBA wizard and several CORBA templates. You can use either tool to generate Java source files (.java files) for the different parts of CORBA programs. The type of program you are writing determines which files you need.
You always need an interface definition language (IDL) file, which defines the interface of a CORBA server. The CORBA module lets you use an existing IDL file or write your own.
The CORBA template enables you to create either a blank IDL file that you can complete in the IDE's editing window or one that you can add elements to using the IDL wizard. It enables you to add IDL elements in correct IDL syntax.
The files you need for a client-side program are:
This class has a main() method that obtains an IOR for a CORBA server. You can generate a client class with the CORBA templates or the CORBA wizard. After generating a client class, you need to add code that uses the IOR to invoke server methods and handles return values.
These classes are generated when you compile the IDL file.
If you are writing a client program to access an existing CORBA server, you need a copy of the IDL file that the server developer wrote.
The files you need for a server-side program are:
This class contains the business logic that can be executed by clients. It is called the implementation class because it contains implementations of the methods declared in the IDL interface. You can generate an implementation class with the CORBA templates or the CORBA wizard. After generating the class, you need to add code that implements the business logic.
This class has a main() method that instantiates the implementation class (creates the servant instance), registers the servant instance with the ORB, and makes the servant instance's IOR available to clients. You can generate a server class with the CORBA templates or the CORBA wizard. After generating a server class, you need to complete the code that makes the servant's IOR available to clients.
These classes are generated when you compile the IDL file.
If you are using the CORBA templates, you should generate and complete your IDL file before generating the other server-side files. If chose the Empty IDL template, you can use the New From Template wizard to write the IDL file. If chose the Simple IDL template, you can complete the IDL file manually in the Source Editor.
See also | |
---|---|
Using the CORBA Module
CORBA Basics |