[Enterprise Extensions only]
  Previous topic

Compiling a CORBA server implementation class IDL (using idlc)

Use this task to compile the IDL file, servant.idl, that defines the public interface for a CORBA server implementation class. You can also use this task to compile the IDL file (also referred to in this task as servant.idl) for an Enterprise JavaBean.

Note: If your servant.idl file references other IDL files, ensure that all those other IDL files can be accessed by the idlc program.

To compile the IDL file, servant.idl, you can use the idlc command to complete the following steps:

  1. At a command line change to the directory that contains the IDL file,servant.idl, where servant is the name of the server implementation class.
  2. Type the following command:
    idlc -ehh:ih:ic:uc:sc servant.idl 
    The options specified, and the files created are summarised in Options for the idlc command. The names of the generated output files are derived from the file name of the specified IDL file. For example, for the IDL file, servant.idl, the emitter option -ehh outputs the file servant.hh.

    This produces the files servant.hh, servant.ih, servant_I.cpp, servant_C.cpp, and servant_S.cpp.

This task creates the usage binding files needed to implement and use the servant object within a particular programming language.

For example, for a server object implemetation class called WSLogger, the IDL file, WSLogger.idl, was created and edited to add its interface definition. To compile the IDL file, the following command was used:
idlc -ehh:ih:ic:uc:sc WSLogger.idl

This created the following files: WSLogger.hh, WSLogger.ih, WSLogger_I.cpp, WSLogger_C.cpp, and WSLogger_S.cpp.

You can next add declarations for class variables, constructors, and destructors to the servant class definition, servant.ih, as described in Adding declarations to the servant class definition.

This task is one step of the parent task, Developing a CORBA server. It can also be used to create the client-side bindings files needed to develop a CORBA client that is to access an Enterprise JavaBean, as described in Developing a CORBA client.

  Previous topic