activemq-cpp-3.6.0
cms::XASession Class Reference

The XASession interface extends the capability of Session by adding access to a CMS provider's support for the operating inside an XA Transaction (optional). More...

#include <src/main/cms/XASession.h>

Inheritance diagram for cms::XASession:

Public Member Functions

virtual ~XASession ()
virtual XAResourcegetXAResource () const =0
 Returns the XA resource associated with this Session to the caller.
- Public Member Functions inherited from cms::Session
virtual ~Session ()
virtual void close ()=0
 Closes this session as well as any active child consumers or producers.
virtual void commit ()=0
 Commits all messages done in this transaction and releases any locks currently held.
virtual void rollback ()=0
 Rolls back all messages done in this transaction and releases any locks currently held.
virtual void recover ()=0
 Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.
virtual MessageConsumercreateConsumer (const Destination *destination)=0
 Creates a MessageConsumer for the specified destination.
virtual MessageConsumercreateConsumer (const Destination *destination, const std::string &selector)=0
 Creates a MessageConsumer for the specified destination, using a message selector.
virtual MessageConsumercreateConsumer (const Destination *destination, const std::string &selector, bool noLocal)=0
 Creates a MessageConsumer for the specified destination, using a message selector.
virtual MessageConsumercreateDurableConsumer (const Topic *destination, const std::string &name, const std::string &selector, bool noLocal=false)=0
 Creates a durable subscriber to the specified topic, using a Message selector.
virtual MessageProducercreateProducer (const Destination *destination=NULL)=0
 Creates a MessageProducer to send messages to the specified destination.
virtual QueueBrowsercreateBrowser (const cms::Queue *queue)=0
 Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual QueueBrowsercreateBrowser (const cms::Queue *queue, const std::string &selector)=0
 Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual QueuecreateQueue (const std::string &queueName)=0
 Creates a queue identity given a Queue name.
virtual TopiccreateTopic (const std::string &topicName)=0
 Creates a topic identity given a Queue name.
virtual TemporaryQueuecreateTemporaryQueue ()=0
 Creates a TemporaryQueue object.
virtual TemporaryTopiccreateTemporaryTopic ()=0
 Creates a TemporaryTopic object.
virtual MessagecreateMessage ()=0
 Creates a new Message.
virtual BytesMessagecreateBytesMessage ()=0
 Creates a BytesMessage.
virtual BytesMessagecreateBytesMessage (const unsigned char *bytes, int bytesSize)=0
 Creates a BytesMessage and sets the payload to the passed value.
virtual StreamMessagecreateStreamMessage ()=0
 Creates a new StreamMessage.
virtual TextMessagecreateTextMessage ()=0
 Creates a new TextMessage.
virtual TextMessagecreateTextMessage (const std::string &text)=0
 Creates a new TextMessage and set the text to the value given.
virtual MapMessagecreateMapMessage ()=0
 Creates a new MapMessage.
virtual AcknowledgeMode getAcknowledgeMode () const =0
 Returns the acknowledgment mode of the session.
virtual bool isTransacted () const =0
 Gets if the Sessions is a Transacted Session.
virtual void unsubscribe (const std::string &name)=0
 Unsubscribes a durable subscription that has been created by a client.
virtual void setMessageTransformer (cms::MessageTransformer *transformer)=0
 Set an MessageTransformer instance that is passed on to all MessageProducer and MessageConsumer objects created from this Session.
virtual cms::MessageTransformergetMessageTransformer () const =0
 Gets the currently configured MessageTransformer for this Session.
- Public Member Functions inherited from cms::Closeable
virtual ~Closeable ()
- Public Member Functions inherited from cms::Startable
virtual ~Startable ()
virtual void start ()=0
 Starts the service.
- Public Member Functions inherited from cms::Stoppable
virtual ~Stoppable ()
virtual void stop ()=0
 Stops this service.

Additional Inherited Members

- Public Types inherited from cms::Session
enum  AcknowledgeMode {
  AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, SESSION_TRANSACTED,
  INDIVIDUAL_ACKNOWLEDGE
}

Detailed Description

The XASession interface extends the capability of Session by adding access to a CMS provider's support for the operating inside an XA Transaction (optional).

This support takes the form of a cms::XAResource object. The functionality of this object closely resembles that defined by the standard X/Open XA Resource interface.

An application controls the transactional assignment of an XASession by obtaining its XAResource. It uses the XAResource to assign the session to a transaction, prepare and commit work on the transaction, and so on.

An XAResource provides some fairly sophisticated facilities for interleaving work on multiple transactions, recovering a list of transactions in progress, and so on. A XA aware CMS provider must fully implement this functionality.

The XASession instance will behave much like a normal cms::Session however some methods will will not operate as normal, any call to Session::commit, or Session::rollback will result in a CMSException being thrown. Also when not inside an XA transaction the MessageConsumer will operate as if it were in the AutoAcknowlege mode.

The XASession interface is optional. CMS providers are not required to support this interface. This interface is for use by CMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Since
2.3

Constructor & Destructor Documentation

virtual cms::XASession::~XASession ( )
virtual

Member Function Documentation

virtual XAResource* cms::XASession::getXAResource ( ) const
pure virtual

Returns the XA resource associated with this Session to the caller.

The client can use the provided XA resource to interact with the XA Transaction Manager in use in the client application.

Returns
an XAResouce instance to the caller, the caller does not own this pointer and should not delete it.

Implemented in activemq::core::ActiveMQXASession, and activemq::core::kernels::ActiveMQXASessionKernel.


The documentation for this class was generated from the following file: