Download "Getting Started"

Transcript
12
Habari Client for OpenMQ 2.9
Communication Adapters
Introduction
Habari Client for OpenMQ uses communication adapters as an abstraction layer for the
TCP/IP library. All connections create their own internal instance of the adapter class.
Configuration of communication adapters
No configuration is required for the communication adapters. Applications specify
communication and connection options in URL parameters or connection class properties
or connection factory settings.
Registration of communication adapter class
A communication adapter implementation can be prepared for usage by simply adding its
Delphi unit to the project. Example:
program ClientUsingIndy;
uses
BTCommAdapterIndy, // use Internet Direct (Indy)
BTConnectionFactory, BTJMSInterfaces,
SysUtils;
...
Behind the scenes, the communication adapter class will register itself with the
communication adapter manager in the BTAdapterRegistry unit.
Default adapter class
Applications typically use only one of the available communication adapter classes for all
connections.
The library allows to register two or more adapter classes and switch at run-time, using
methods in the adapter registry in unit BTAdapterRegistry - this feature is mainly for
tests and demonstration purposes.
If more than one communication adapter is in the project, the first adapter class in the
list will be the default adapter class. Example:
program ClientUsingIndyOrSynapse;
uses
BTCommAdapterIndy, // use Internet Direct (Indy) as default adapter class
BTCommAdapterSynapse, // and register the Synapse adapter class
BTConnectionFactory, BTJMSInterfaces,
SysUtils;