CORBA 2.6.1 Programmer's Guide for C++

Chapter 12. Writing Wrappers for Legacy Clients and Servers
Chapter 12. Writing Wrappers for Legacy Clients and Servers
Writing a Wrapper for a Legacy Server
Basic Structure of a Server Wrapper
Calling a Context-Free TS/MP Server for Nowait Operations
Calling a Context-Free or Context-Sensitive Pathsend Server for Waited Operations
Calling a TCP/IP Server
Calling Other Types of Legacy Servers
Managing Transactions in Server Wrappers
Writing a Wrapper for a Legacy Client
Basic Structure of a Client Wrapper
Writing a Client Wrapper for a Context-Free Pathsend Requester
Writing a Client Wrapper for a Remote (TCP/IP) Client
Writing Other Types of Client Wrappers
Managing Transactions in Client Wrappers
The NonStop CORBA Event Framework APIs
Design of the Event Framework
Header Files
Base Event-Handler Interfaces
Event Framework Messages and Message Data Descriptors
Guardian File-System Event Handlers and Event-Handler Users (Class NSDEFw_GFS)
TS/MP Event Handlers and Event-Handler Users (Class NSDEFw_GCF)
TCP/IP Socket Event Handlers and Event-Handler Users (Classes Fw_Event, Fw_Sock_Client_EH, Fw_Sock_Server_EH, and
Fw_Sock_Listener_EH)
This section describes how to write a NonStop CORBA application that includes existing non-CORBA clients or existing non-CORBA servers.
Note:
In this section, the term “legacy” refers to any client or server program that is not a CORBA program. Such a
program may be an older program that you want to incorporate into a NonStop CORBA application without making
changes to it, but that does not have to be the case.
Legacy wrapping is a technique that enables a CORBA-based program to interoperate with a non-CORBA-based client or server. A legacy
wrapper is a NonStop CORBA program that wraps around a non-CORBA program so that the non-CORBA program can be integrated with
standard CORBA programs.
For example, you might have an operational NonStop TS/MP 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 12–1.