Bionic Buffalo Tech Note #25: Quick Start Guide to Writing CORBA Server Applications
Servants for Each Interface
For each interface, the IDL compiler generate (as required by the specification)
prototypes and initialization and finalization routines for the interface's servant. In
addition, Bionic Buffalo's
france compiler will (if asked) generate a sample servant for
each interface. The sample servant employs the sample methods created for each of the
operations and attributes of the interface. Thus, by default, the sample servant will raise
NO_IMPLEMENT for each of its operations and attributes, or the behaviour may be
modified by setting the
VUT_METHOD_SELECTOR macro at compile time.
Installation Routines for Each Interface
For each interface described in the IDL, Bionic Buffalo's
france IDL compiler will (if
asked) generate an installation routine which will install the sample servant and methods,
creating (if necessary) a suitably configured
POA. It will also generate an uninstall
routine, to remove them.
Object Creation Routines for Each Interface
For each interface described in the IDL, Bionic Buffalo's
france IDL compiler will (if
asked) generate object creation and destruction routines to create and destroy objects with
the specified interface. The object creation and destruction routines will allocate or
release state structures as required, including the necessary database operations.
Design and Code the Application
A CORBA server application usually has at least five basic parts:
An installation routine to set up the
POA, servants, and related objects (such as servant managers)
A startup routine to create one or more initial objects, whose references will be passed or advertised
to potential clients
The servants and related objects themselves
A shutdown routine to destroy objects created by the startup routine
A uninstallation routine to remove the
POA, servants, and related objects
Installation
The installation routine must install and configure any
POAs, servants, servant managers, and other
services or objects required by the server application.
1. Use
CORBA_ORB_init(), if necessary, to obtain a reference for the ORB which will own the
objects.
2. Use
ORB::resolve_initial_references() to obtain a reference for the Root POA.
3. Iteratively use
POA::find_POA() to traverse the POA tree. Use POA::create_POA() to
create any needed
POAs.
4. Create and install any required
AdapterActivator, ServantActivator, and
Page 10 of 12