The XMS API
is an object-oriented interface. The XMS object
model is based on the JMS 1.1 object model.
The following list summarizes the main
XMS classes,
or types of object:
- ConnectionFactory
- A ConnectionFactory object encapsulates a set of configuration
parameters for a connection. An application uses a ConnectionFactory
to create a connection. An application can create a ConnectionFactory
object at run time, or it can create a ConnectionFactory object from
an object definition that is retrieved from a repository of administered
objects.
- Connection
- A Connection object encapsulates an application's active connection
to a messaging server. An application uses a connection to create
sessions.
- Destination
- The source from where an application sends messages or receives
messages. In the publish/subscribe domain,
a Destination object encapsulates a topic and, in the point-to-point domain,
a Destination object encapsulates a queue. An application can create
a Destination object at run time, or it can create a Destination object
from an object definition that is retrieved from a repository of administered
objects.
- Session
- A session is a single threaded context for sending and receiving
messages. An application uses a session to create messages, message
producers, and message consumers.
- Message
- A Message object encapsulates a message that an application sends
(MessageProducer) or receives (MessageConsumer).
- MessageProducer
- An object used by an application to send messages to a destination.
- MessageConsumer
- An object used by an application to receive messages sent to a
destination.
Figure 1 shows these objects
and their relationships.
Figure 1. XMS objects
and their relationships
XMS applications
written in C++ use
these classes and their methods. XMS applications
written in C use the same object model even though C is not an object
oriented language. When a C application calls a function to create
an object, XMS stores the object internally and returns a handle for
the object to the application. The application can then use the handle
subsequently to access the object. For example, if a C application
creates a ConnectionFactory, XMS returns
a handle for the ConnectionFactory to the application. In general,
for each C++ method in the C++ interface, there is an equivalent C
function in the C interface.
The XMS object
model is based on the domain independent interfaces that are described
in Java Message
Service Specification, Version 1.1.
Domain specific classes, such as Topic, TopicPublisher, and TopicSubscriber,
are not provided.