Data Transformation Engine Services Guide

Chapter 12 – Introduction to Custom Adapters
94
Chapter 12 – Introduction to
Custom Adapters
Mercator Command Server adapters provide a way to specify and manipulate data
sources and targets. Each adapter is accompanied by a set of adapter commands that can
be used to customize its operation.
Adapters for Mercator Command Server are normally written as separate shared
libraries (or DLLs on Windows NT). When the Mercator Command Server needs to
call the adapter, it loads the adapter, resolves to the entry point in the adapter, and then
executes the function.
For the NonStop Himalaya, this method cannot be used since there are no shared
libraries. All adapters must be linked in with the Mercator Command Server, and
therefore cannot be dynamically loaded at runtime.
There are two steps to writing an adapter for Mercator Command Server on the
NonStop Himalaya:
1. Write the adapter and create an archive of the objects comprising the adapter.
2. Integrate the adapter into the engine by doing the following:
1. Change the engine makefile to include the adapter.
2. Link the adapter objects (archive library) with the engine.
3. Modify the ini file to describe the new adapter.
This section also describes how to customize the Mercator Command Server in order
to remove one or more of the Mercator-supplied adapters.
Architecture
The Resource Manager is the component of the Mercator Command Server that
communicates with the adapter[s]. It attempts to maintain a connection throughout the
life of a map or set of maps. The NonStop server implementation uses the Resource
Manager for accessing adapter functions.
The Resource Manager creates a thread for the purpose of accessing a certain resource.
There is therefore a one-to-one relationship between a thread and a connection. These
“connection threads” perform all the adapter functions that access a particular resource.
The definition of a “connection” is adapter specific. For example, for one messaging
system, a connection may be to a queue manager, whereas to another, it may be to a
specific queue. Throughout this section, the terms “thread” andconnection” are used
interchangeably.