A single threaded MQ context which can create producers and consumers.
Contexts are NOT thread-safe and are designed to be used by a single thread
at a time. A context is roughly equivalent to the JMS 1.1 concepts of a
Connection and Session and therefore follow the same threading rules as the
more restrictive Session.
When an application needs to send messages it use the createProducer method
to create a producer which provides methods to configure and send messages.
When an application needs to receive messages it uses the createConsumer
method to create a consumer. A consumer provides methods to receive messages
either synchronously or asynchronously.
A context must be closed using the
#close() method when it is no
longer needed to prevent resource leaks.
An XA context can return an
XAResource for participation in a global,
two-phase commit transaction. All transaction management must be done through
the resource. The transaction must be committed to release the messages to
the underlying queue or topic.