activemq-cpp-3.6.0
|
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>
Public Member Functions | |
virtual | ~XASession () |
virtual XAResource * | getXAResource () const =0 |
Returns the XA resource associated with this Session to the caller. | |
![]() | |
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 MessageConsumer * | createConsumer (const Destination *destination)=0 |
Creates a MessageConsumer for the specified destination. | |
virtual MessageConsumer * | createConsumer (const Destination *destination, const std::string &selector)=0 |
Creates a MessageConsumer for the specified destination, using a message selector. | |
virtual MessageConsumer * | createConsumer (const Destination *destination, const std::string &selector, bool noLocal)=0 |
Creates a MessageConsumer for the specified destination, using a message selector. | |
virtual MessageConsumer * | createDurableConsumer (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 MessageProducer * | createProducer (const Destination *destination=NULL)=0 |
Creates a MessageProducer to send messages to the specified destination. | |
virtual QueueBrowser * | createBrowser (const cms::Queue *queue)=0 |
Creates a new QueueBrowser to peek at Messages on the given Queue. | |
virtual QueueBrowser * | createBrowser (const cms::Queue *queue, const std::string &selector)=0 |
Creates a new QueueBrowser to peek at Messages on the given Queue. | |
virtual Queue * | createQueue (const std::string &queueName)=0 |
Creates a queue identity given a Queue name. | |
virtual Topic * | createTopic (const std::string &topicName)=0 |
Creates a topic identity given a Queue name. | |
virtual TemporaryQueue * | createTemporaryQueue ()=0 |
Creates a TemporaryQueue object. | |
virtual TemporaryTopic * | createTemporaryTopic ()=0 |
Creates a TemporaryTopic object. | |
virtual Message * | createMessage ()=0 |
Creates a new Message. | |
virtual BytesMessage * | createBytesMessage ()=0 |
Creates a BytesMessage. | |
virtual BytesMessage * | createBytesMessage (const unsigned char *bytes, int bytesSize)=0 |
Creates a BytesMessage and sets the payload to the passed value. | |
virtual StreamMessage * | createStreamMessage ()=0 |
Creates a new StreamMessage. | |
virtual TextMessage * | createTextMessage ()=0 |
Creates a new TextMessage. | |
virtual TextMessage * | createTextMessage (const std::string &text)=0 |
Creates a new TextMessage and set the text to the value given. | |
virtual MapMessage * | createMapMessage ()=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::MessageTransformer * | getMessageTransformer () const =0 |
Gets the currently configured MessageTransformer for this Session. | |
![]() | |
virtual | ~Closeable () |
![]() | |
virtual | ~Startable () |
virtual void | start ()=0 |
Starts the service. | |
![]() | |
virtual | ~Stoppable () |
virtual void | stop ()=0 |
Stops this service. |
Additional Inherited Members | |
![]() | |
enum | AcknowledgeMode { AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, SESSION_TRANSACTED, INDIVIDUAL_ACKNOWLEDGE } |
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.
|
virtual |
|
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.
Implemented in activemq::core::ActiveMQXASession, and activemq::core::kernels::ActiveMQXASessionKernel.