Why and when to perform this task
Use this task to define the public interface of a CORBA servant class. It provides the business logic to be used by clients. This defines the information that a client must know to call and use servant objects of that class and forms one stage of the tasks to develop a CORBA server or client.
Steps for this task
The following information is an overview of the format of an interface declaration. It provides links to the reference topics that describe parts of the IDL declaration and IDL syntax. For reference information about IDL interface declarations and the component declarations that they can contain, see IDL interface declarations.
An interface declaration has the following syntax:
interface interface-name [: base-interface1, base-interface2, ...] { [constant declarations] [type declarations] [exception declarations] [attribute declarations] [operation declarations] };
Specify base interface names only if this interface is derived from one or more parent interfaces. Each base interface is specified in the form, interface_name, and can be named only once in the interface statement header. If you specify a base interface name, you also must add an include statement for the base interface IDL file to the top of the servant.idl file.
The order in which these declarations are specified is usually optional and declarations of different kinds can be intermixed. Although all of the declarations listed previously are optional, in some cases using one declaration can mandate another. For example, if an operation raises an exception, the exception structure must be defined beforehand. In general, types, constants, and exceptions, as well as interface declarations, must be defined before they are referenced, as in C or C++.
Results
This task results in a fully specified IDL file, servant.idl, that contains a declaration for the public interface to a servant class, servant.
For example, for a servant class called WSLogger, the IDL file, WSLogger.idl, was created and edited to add the following interface definition:
interface WSLogger { void setFileName(in string newFileName); string getFileName(); void setMethodName( in string newMethodName ); string getMethodName(); short openLogFile(); short closeLogFile(); short writeLogMessage(in string newMessage, in short newSeverity); enum mdyFormat { DMY_DATE_FORMAT, MDY_DATE_FORMAT }; void setDateFormat(in unsigned short newDateFormat); unsigned short getDateFormat(); };
What to do next
Compile the servant.idl to create the usage bindings and other files needed to complete the implementation as described in Compiling the servant IDL (using idlc).