CORBA 2.3.7 Programmer's Guide for C++
For example, you might have an operational Pathway server program that you want to make accessible to remote
CORBA clients. By creating a legacy server wrapper, you can provide an object-oriented CORBA interface to your
legacy server without making changes to the legacy server itself. You can also develop a legacy client wrapper to allow
non-CORBA clients to make use of a CORBA server.
This section provides the following information:
Writing a Wrapper for a Legacy Server, which outlines how to write various types of server wrappers●
Writing a Wrapper for a Legacy Client, which outlines how to write various types of client wrappers●
The NonStop CORBA Event Framework APIs, which describes the general functions of the NonStop CORBA
APIs that must be used by client wrappers and some types of server wrappers
●
The Bank sample is a set of programs that illustrate the concept of legacy wrapping. The Readme file for this sample
provides a description and walkthrough of these programs, including how to build and run them in various combinations.
Writing a Wrapper for a Legacy Server
A legacy server wrapper accepts requests from a CORBA client and forwards them to a non-CORBA server. It
transforms CORBA operations into legacy-server requests and legacy replies into CORBA completions.
From the client's perspective, the wrapper is a CORBA server. From the server's perspective, the wrapper is a legacy
client. Thus, the server wrapper acts as a bridge between a CORBA client and a legacy server, as shown in Figure 121 .
Figure 11.1. Legacy Server Wrapper
Basic Structure of a Server Wrapper
Because it is a NonStop CORBA server, the server wrapper must perform the usual ORB initialization operations:
Call ORB::init().1.
Create a POA.2.
Create a servant.3.
Activate the servant.4.
Call ORB::run().5.
The ORB::run() operation blocks the main thread until the server is shut down. This blocking allows the event thread
to take over to receive I/O events.
The wrapper then must receive CORBA requests from the client. Regardless of which operation is invoked by the client,
the server must do the following:
Marshal the parameters into a legacy request.1.
Use an appropriate API (one recognized by that type of legacy server) to deliver the legacy request to the legacy
server and wait for the reply.
2.