activemq-cpp-3.6.0
|
#include <src/main/activemq/core/ActiveMQSession.h>
Public Member Functions | |
ActiveMQSession (Pointer< activemq::core::kernels::ActiveMQSessionKernel > kernel) | |
virtual | ~ActiveMQSession () |
virtual void | start () |
Stops asynchronous message delivery. | |
virtual void | stop () |
Starts asynchronous message delivery. | |
bool | isStarted () const |
Indicates whether or not the session is currently in the started state. | |
virtual void | close () |
Closes this session as well as any active child consumers or producers. | |
virtual void | commit () |
Commits all messages done in this transaction and releases any locks currently held. | |
virtual void | rollback () |
Rolls back all messages done in this transaction and releases any locks currently held. | |
virtual void | recover () |
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message. | |
virtual cms::MessageConsumer * | createConsumer (const cms::Destination *destination) |
Creates a MessageConsumer for the specified destination. | |
virtual cms::MessageConsumer * | createConsumer (const cms::Destination *destination, const std::string &selector) |
Creates a MessageConsumer for the specified destination, using a message selector. | |
virtual cms::MessageConsumer * | createConsumer (const cms::Destination *destination, const std::string &selector, bool noLocal) |
Creates a MessageConsumer for the specified destination, using a message selector. | |
virtual cms::MessageConsumer * | createDurableConsumer (const cms::Topic *destination, const std::string &name, const std::string &selector, bool noLocal=false) |
Creates a durable subscriber to the specified topic, using a Message selector. | |
virtual cms::MessageProducer * | createProducer (const cms::Destination *destination) |
Creates a MessageProducer to send messages to the specified destination. | |
virtual cms::QueueBrowser * | createBrowser (const cms::Queue *queue) |
Creates a new QueueBrowser to peek at Messages on the given Queue. | |
virtual cms::QueueBrowser * | createBrowser (const cms::Queue *queue, const std::string &selector) |
Creates a new QueueBrowser to peek at Messages on the given Queue. | |
virtual cms::Queue * | createQueue (const std::string &queueName) |
Creates a queue identity given a Queue name. | |
virtual cms::Topic * | createTopic (const std::string &topicName) |
Creates a topic identity given a Queue name. | |
virtual cms::TemporaryQueue * | createTemporaryQueue () |
Creates a TemporaryQueue object. | |
virtual cms::TemporaryTopic * | createTemporaryTopic () |
Creates a TemporaryTopic object. | |
virtual cms::Message * | createMessage () |
Creates a new Message. | |
virtual cms::BytesMessage * | createBytesMessage () |
Creates a BytesMessage. | |
virtual cms::BytesMessage * | createBytesMessage (const unsigned char *bytes, int bytesSize) |
Creates a BytesMessage and sets the payload to the passed value. | |
virtual cms::StreamMessage * | createStreamMessage () |
Creates a new StreamMessage. | |
virtual cms::TextMessage * | createTextMessage () |
Creates a new TextMessage. | |
virtual cms::TextMessage * | createTextMessage (const std::string &text) |
Creates a new TextMessage and set the text to the value given. | |
virtual cms::MapMessage * | createMapMessage () |
Creates a new MapMessage. | |
virtual cms::Session::AcknowledgeMode | getAcknowledgeMode () const |
Returns the acknowledgment mode of the session. | |
virtual bool | isTransacted () const |
Gets if the Sessions is a Transacted Session. | |
virtual void | unsubscribe (const std::string &name) |
Unsubscribes a durable subscription that has been created by a client. | |
cms::ExceptionListener * | getExceptionListener () |
This method gets any registered exception listener of this sessions connection and returns it. | |
virtual void | setMessageTransformer (cms::MessageTransformer *transformer) |
Set an MessageTransformer instance that is passed on to all MessageProducer and MessageConsumer objects created from this Session. | |
virtual cms::MessageTransformer * | getMessageTransformer () const |
Gets the currently configured MessageTransformer for this Session. | |
const commands::SessionInfo & | getSessionInfo () const |
Gets the Session Information object for this session, if the session is closed than this method throws an exception. | |
const commands::SessionId & | getSessionId () const |
Gets the Session Id object for this session, if the session is closed than this method throws an exception. | |
ActiveMQConnection * | getConnection () const |
Gets the ActiveMQConnection that is associated with this session. | |
Public Member Functions inherited from cms::Session | |
virtual | ~Session () |
Public Member Functions inherited from cms::Closeable | |
virtual | ~Closeable () |
Public Member Functions inherited from cms::Startable | |
virtual | ~Startable () |
Public Member Functions inherited from cms::Stoppable | |
virtual | ~Stoppable () |
Protected Attributes | |
Pointer < activemq::core::kernels::ActiveMQSessionKernel > | kernel |
Additional Inherited Members | |
Public Types inherited from cms::Session | |
enum | AcknowledgeMode { AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, SESSION_TRANSACTED, INDIVIDUAL_ACKNOWLEDGE } |
activemq::core::ActiveMQSession::ActiveMQSession | ( | Pointer< activemq::core::kernels::ActiveMQSessionKernel > | kernel | ) |
|
virtual |
|
virtual |
Closes this session as well as any active child consumers or producers.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Commits all messages done in this transaction and releases any locks currently held.
CMSException | - If an internal error occurs. |
IllegalStateException | - if the method is not called by a transacted session. |
Implements cms::Session.
Reimplemented in activemq::core::ActiveMQXASession.
|
virtual |
Creates a new QueueBrowser to peek at Messages on the given Queue.
queue | the Queue to browse |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if the destination given is invalid. |
Implements cms::Session.
|
virtual |
Creates a new QueueBrowser to peek at Messages on the given Queue.
queue | the Queue to browse |
selector | the Message selector to filter which messages are browsed. |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if the destination given is invalid. |
Implements cms::Session.
|
virtual |
Creates a BytesMessage.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a BytesMessage and sets the payload to the passed value.
bytes | an array of bytes to set in the message |
bytesSize | the size of the bytes array, or number of bytes to use |
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a MessageConsumer for the specified destination.
destination | the Destination that this consumer receiving messages for. |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if an invalid destination is specified. |
Implements cms::Session.
|
virtual |
Creates a MessageConsumer for the specified destination, using a message selector.
destination | the Destination that this consumer receiving messages for. |
selector | the Message Selector to use |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if an invalid destination is specified. |
InvalidSelectorException | - if the message selector is invalid. |
Implements cms::Session.
|
virtual |
Creates a MessageConsumer for the specified destination, using a message selector.
destination | the Destination that this consumer receiving messages for. |
selector | the Message Selector to use |
noLocal | if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue. |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if an invalid destination is specified. |
InvalidSelectorException | - if the message selector is invalid. |
Implements cms::Session.
|
virtual |
Creates a durable subscriber to the specified topic, using a Message selector.
Sessions that create durable consumers must use the same client Id as was used the last time the subscription was created in order to receive all messages that were delivered while the client was offline.
destination | the topic to subscribe to |
name | The name used to identify the subscription |
selector | the Message Selector to use |
noLocal | if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue. |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if an invalid destination is specified. |
InvalidSelectorException | - if the message selector is invalid. |
Implements cms::Session.
|
virtual |
Creates a new MapMessage.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a new Message.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a MessageProducer to send messages to the specified destination.
destination | the Destination to send on |
CMSException | - If an internal error occurs. |
InvalidDestinationException | - if an invalid destination is specified. |
Implements cms::Session.
|
virtual |
Creates a queue identity given a Queue name.
queueName | the name of the new Queue |
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a new StreamMessage.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a TemporaryQueue object.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a TemporaryTopic object.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a new TextMessage.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a new TextMessage and set the text to the value given.
text | the initial text for the message |
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
virtual |
Creates a topic identity given a Queue name.
topicName | the name of the new Topic |
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
inlinevirtual |
Returns the acknowledgment mode of the session.
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
inline |
Gets the ActiveMQConnection that is associated with this session.
|
inline |
This method gets any registered exception listener of this sessions connection and returns it.
Mainly intended for use by the objects that this session creates so that they can notify the client of exceptions that occur in the context of another thread.
|
inlinevirtual |
Gets the currently configured MessageTransformer for this Session.
Implements cms::Session.
|
inline |
Gets the Session Id object for this session, if the session is closed than this method throws an exception.
|
inline |
Gets the Session Information object for this session, if the session is closed than this method throws an exception.
|
inline |
Indicates whether or not the session is currently in the started state.
|
inlinevirtual |
Gets if the Sessions is a Transacted Session.
CMSException | - If an internal error occurs. |
Implements cms::Session.
Reimplemented in activemq::core::ActiveMQXASession.
|
virtual |
Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.
All consumers deliver messages in a serial order. Acknowledging a received message automatically acknowledges all messages that have been delivered to the client.
Restarting a session causes it to take the following actions:
CMSException | - if the CMS provider fails to stop and restart message delivery due to some internal error. |
IllegalStateException | - if the method is called by a transacted session. |
Implements cms::Session.
|
virtual |
Rolls back all messages done in this transaction and releases any locks currently held.
CMSException | - If an internal error occurs. |
IllegalStateException | - if the method is not called by a transacted session. |
Implements cms::Session.
Reimplemented in activemq::core::ActiveMQXASession.
|
inlinevirtual |
Set an MessageTransformer instance that is passed on to all MessageProducer and MessageConsumer objects created from this Session.
transformer | Pointer to the cms::MessageTransformer to set on all MessageConsumers and MessageProducers. |
Implements cms::Session.
|
virtual |
Stops asynchronous message delivery.
Implements cms::Startable.
|
virtual |
Starts asynchronous message delivery.
Implements cms::Stoppable.
|
virtual |
Unsubscribes a durable subscription that has been created by a client.
This method deletes the state being maintained on behalf of the subscriber by its provider. It is erroneous for a client to delete a durable subscription while there is an active MessageConsumer or Subscriber for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.
name | The name used to identify this subscription |
CMSException | - If an internal error occurs. |
Implements cms::Session.
|
protected |