CORBA server programming model

This topic describes the CORBA server programming model, which describes the interfaces and processes used to develop CORBA server objects that make up the business logic and business data inherent in a server application. Application programmers use the server programming model if they are developing CORBA server implementation objects, known as servant objects, that perform business functions used in the implementation of client objects.

The concepts about the server programming model are derived from the following general procedure for developing a CORBA server. For task information about developing a CORBA server, see "Developing a CORBA C++ server". Examples of server programming are given in the WSLoggerServer sample, accessible from the Samples Gallery, which is installed with WebSphere Application Server.

  1. Specify the business logic implementation interface for the servant (servant.idl).

    In an Interface Definition Language (IDL)file, you define the public interface to the methods provided by the business logic. This defines the information that a client must know to call and use a servant object. For more information about the IDL definition of an implementation, see "Interface Definition Language (IDL)".

  2. Compile the servant IDL (using idlc).

    Compiling the servant IDL file produces the usage binding files to implement and use the servant object within a particular programming language. For example, this creates an implementation template that provides a native, server language class template into which method behavior can be inserted. WebSphere supports CORBA servers implemented in C++.

  3. Add declarations for class variables, constructors, and destructors to the servant class definition (servant.ih).

    The implementation class interface header (servant.ih) created by idlc contains a skeleton class definition, but lacks declarations for class variables, constructors, and destructors. You need to add the missing declarations.

  4. Complete the servant implementation (servant_I.cpp).The implementation class (servant_I.cpp) created by idlc contains a skeleton implementation definition, which you need to complete by adding the business logic that the servant provides.
  5. Create the server main code (server.cpp).

    Create the server code to define the methods that the server implements. In particular, create the main() function, which controls the server run time by performing the following tasks:

    1. Validating user input
    2. Initializing the server environment
    3. Accessing naming contexts
    4. Creating a servant object
    5. Binding the servant object to the appropriate naming context
    6. Creating a server shut down object
    7. Going into a wait loop
    8. Servicing requests
  6. Build the server object and server code.

    Like any other programming model, you need to build the modules that the server host can use to run the server and the servant.

  7. Store a logical definition for the server in the system implementation repository (using regimpl).

    Each server needs a unique logical definition in the implementation repository of the host on which the server runs. The logical definition defines the server alias that is used to control the server.


Related concepts
CORBA programming model
Interface Definition Language (IDL)
Related tasks
Developing a CORBA C++ server



Searchable topic ID:   ccor_ipgms0
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/concepts/ccor_ipgms0.html

Library | Support | Terms of Use | Feedback