activemq-cpp-3.6.0
activemq::core::kernels::ActiveMQXASessionKernel Class Reference

#include <src/main/activemq/core/kernels/ActiveMQXASessionKernel.h>

Inheritance diagram for activemq::core::kernels::ActiveMQXASessionKernel:

Public Member Functions

 ActiveMQXASessionKernel (ActiveMQConnection *connection, const Pointer< commands::SessionId > &sessionId, const decaf::util::Properties &properties)
virtual ~ActiveMQXASessionKernel ()
virtual bool isTransacted () const
 Gets if the Sessions is a Transacted Session.
virtual bool isAutoAcknowledge () const
virtual void doStartTransaction ()
 Starts if not already start a Transaction for this Session.
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 cms::XAResourcegetXAResource () const
 Returns the XA resource associated with this Session to the caller.
- Public Member Functions inherited from cms::XASession
virtual ~XASession ()
- 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 ()
- Public Member Functions inherited from activemq::core::kernels::ActiveMQSessionKernel
 ActiveMQSessionKernel (ActiveMQConnection *connection, const Pointer< commands::SessionId > &id, cms::Session::AcknowledgeMode ackMode, const decaf::util::Properties &properties)
virtual ~ActiveMQSessionKernel ()
virtual void redispatch (MessageDispatchChannel &unconsumedMessages)
 Redispatches the given set of unconsumed messages to the consumers.
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 bool isDupsOkAcknowledge () const
virtual bool isClientAcknowledge () const
virtual bool isIndividualAcknowledge () const
void fire (const exceptions::ActiveMQException &ex)
 Fires the given exception to the exception listener of the connection.
virtual void dispatch (const Pointer< MessageDispatch > &message)
 Dispatches a message to a particular consumer.
virtual void close ()
 Closes this session as well as any active child consumers or producers.
virtual void recover ()
 Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.
virtual cms::MessageConsumercreateConsumer (const cms::Destination *destination)
 Creates a MessageConsumer for the specified destination.
virtual cms::MessageConsumercreateConsumer (const cms::Destination *destination, const std::string &selector)
 Creates a MessageConsumer for the specified destination, using a message selector.
virtual cms::MessageConsumercreateConsumer (const cms::Destination *destination, const std::string &selector, bool noLocal)
 Creates a MessageConsumer for the specified destination, using a message selector.
virtual cms::MessageConsumercreateDurableConsumer (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::MessageProducercreateProducer (const cms::Destination *destination)
 Creates a MessageProducer to send messages to the specified destination.
virtual cms::QueueBrowsercreateBrowser (const cms::Queue *queue)
 Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual cms::QueueBrowsercreateBrowser (const cms::Queue *queue, const std::string &selector)
 Creates a new QueueBrowser to peek at Messages on the given Queue.
virtual cms::QueuecreateQueue (const std::string &queueName)
 Creates a queue identity given a Queue name.
virtual cms::TopiccreateTopic (const std::string &topicName)
 Creates a topic identity given a Queue name.
virtual cms::TemporaryQueuecreateTemporaryQueue ()
 Creates a TemporaryQueue object.
virtual cms::TemporaryTopiccreateTemporaryTopic ()
 Creates a TemporaryTopic object.
virtual cms::MessagecreateMessage ()
 Creates a new Message.
virtual cms::BytesMessagecreateBytesMessage ()
 Creates a BytesMessage.
virtual cms::BytesMessagecreateBytesMessage (const unsigned char *bytes, int bytesSize)
 Creates a BytesMessage and sets the payload to the passed value.
virtual cms::StreamMessagecreateStreamMessage ()
 Creates a new StreamMessage.
virtual cms::TextMessagecreateTextMessage ()
 Creates a new TextMessage.
virtual cms::TextMessagecreateTextMessage (const std::string &text)
 Creates a new TextMessage and set the text to the value given.
virtual cms::MapMessagecreateMapMessage ()
 Creates a new MapMessage.
virtual
cms::Session::AcknowledgeMode 
getAcknowledgeMode () const
 Returns the acknowledgment mode of the session.
virtual void unsubscribe (const std::string &name)
 Unsubscribes a durable subscription that has been created by a client.
void send (kernels::ActiveMQProducerKernel *producer, Pointer< commands::ActiveMQDestination > destination, cms::Message *message, int deliveryMode, int priority, long long timeToLive, util::MemoryUsage *producerWindow, long long sendTimeout, cms::AsyncCallback *onComplete)
 Sends a message from the Producer specified using this session's connection the message will be sent using the best available means depending on the configuration of the connection.
cms::ExceptionListenergetExceptionListener ()
 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::MessageTransformergetMessageTransformer () const
 Gets the currently configured MessageTransformer for this Session.
const commands::SessionInfogetSessionInfo () const
 Gets the Session Information object for this session, if the session is closed than this method throws an exception.
const commands::SessionIdgetSessionId () const
 Gets the Session Id object for this session, if the session is closed than this method throws an exception.
ActiveMQConnectiongetConnection () const
 Gets the ActiveMQConnection that is associated with this session.
Pointer< threads::SchedulergetScheduler () const
 Gets a Pointer to this Session's Scheduler instance.
long long getLastDeliveredSequenceId () const
 Gets the currently set Last Delivered Sequence Id.
void setLastDeliveredSequenceId (long long value)
 Sets the value of the Last Delivered Sequence Id.
void oneway (Pointer< commands::Command > command)
 Sends a Command to the broker without requesting any Response be returned.
Pointer< commands::ResponsesyncRequest (Pointer< commands::Command > command, unsigned int timeout=0)
 Sends a synchronous request and returns the response from the broker.
void addConsumer (Pointer< ActiveMQConsumerKernel > consumer)
 Adds a MessageConsumerKernel to this session registering it with the Connection and store a reference to it so the session can ensure that all resources are closed when the session is closed.
void removeConsumer (Pointer< ActiveMQConsumerKernel > consumer)
 Dispose of a MessageConsumer from this session.
void addProducer (Pointer< ActiveMQProducerKernel > producer)
 Adds a MessageProducer to this session registering it with the Connection and store a reference to it so the session can ensure that all resources are closed when the session is closed.
void removeProducer (Pointer< ActiveMQProducerKernel > producer)
 Dispose of a MessageProducer from this session.
Pointer
< ActiveMQTransactionContext
getTransactionContext ()
 Gets the Pointer to this Session's TransactionContext.
void acknowledge ()
 Request that the Session inform all its consumers to Acknowledge all Message's that have been received so far.
void deliverAcks ()
 Request that this Session inform all of its consumers to deliver their pending acks.
void clearMessagesInProgress ()
 Request that this Session inform all of its consumers to clear all messages that are currently in progress.
void wakeup ()
 Causes the Session to wakeup its executer and ensure all messages are dispatched.
Pointer< commands::ConsumerIdgetNextConsumerId ()
 Get the Next available Consumer Id.
Pointer< commands::ProducerIdgetNextProducerId ()
 Get the Next available Producer Id.
void doClose ()
 Performs the actual Session close operations.
void dispose ()
 Cleans up the Session object's resources without attempting to send the Remove command to the broker, this can be called from ActiveMQConnection when it knows that the transport is down and the doClose method would throw an exception when it attempt to send the Remove Command.
void setPrefetchSize (Pointer< commands::ConsumerId > id, int prefetch)
 Set the prefetch level for the given consumer if it exists in this Session to the value specified.
void close (Pointer< commands::ConsumerId > id)
 Close the specified consumer if present in this Session.
bool isInUse (Pointer< commands::ActiveMQDestination > destination)
 Checks if the given destination is currently in use by any consumers in this Session.
Pointer< ActiveMQProducerKernellookupProducerKernel (Pointer< commands::ProducerId > id)
Pointer< ActiveMQConsumerKernellookupConsumerKernel (Pointer< commands::ConsumerId > id)
bool iterateConsumers ()
 Gives each consumer a chance to dispatch messages that have been enqueued by calling each consumers iterate method.

Additional Inherited Members

- Public Types inherited from cms::Session
enum  AcknowledgeMode {
  AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, SESSION_TRANSACTED,
  INDIVIDUAL_ACKNOWLEDGE
}
- Protected Attributes inherited from activemq::core::kernels::ActiveMQSessionKernel
SessionConfig * config
Pointer< commands::SessionInfosessionInfo
 SessionInfo for this Session.
Pointer
< ActiveMQTransactionContext
transaction
 Transaction Management object.
ActiveMQConnectionconnection
 Connection.
AtomicBoolean closed
 Indicates that this connection has been closed, it is no longer usable after this becomes true.
std::auto_ptr
< ActiveMQSessionExecutor
executor
 Sends incoming messages to the registered consumers.
cms::Session::AcknowledgeMode ackMode
 This Sessions Acknowledgment mode.
util::LongSequenceGenerator producerIds
 Next available Producer Id.
util::LongSequenceGenerator producerSequenceIds
 Next available Producer Sequence Id.
util::LongSequenceGenerator consumerIds
 Next available Consumer Id.
long long lastDeliveredSequenceId
 Last Delivered Sequence Id.

Constructor & Destructor Documentation

activemq::core::kernels::ActiveMQXASessionKernel::ActiveMQXASessionKernel ( ActiveMQConnection connection,
const Pointer< commands::SessionId > &  sessionId,
const decaf::util::Properties properties 
)
virtual activemq::core::kernels::ActiveMQXASessionKernel::~ActiveMQXASessionKernel ( )
virtual

Member Function Documentation

virtual void activemq::core::kernels::ActiveMQXASessionKernel::commit ( )
virtual

Commits all messages done in this transaction and releases any locks currently held.

Exceptions
CMSException- If an internal error occurs.
IllegalStateException- if the method is not called by a transacted session.

Reimplemented from activemq::core::kernels::ActiveMQSessionKernel.

virtual void activemq::core::kernels::ActiveMQXASessionKernel::doStartTransaction ( )
virtual

Starts if not already start a Transaction for this Session.

If the session is not a Transacted Session then an exception is thrown. If a transaction is already in progress then this method has no effect.

Exceptions
ActiveMQExceptionif this is not a Transacted Session.

Reimplemented from activemq::core::kernels::ActiveMQSessionKernel.

virtual cms::XAResource* activemq::core::kernels::ActiveMQXASessionKernel::getXAResource ( ) const
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.

Implements cms::XASession.

virtual bool activemq::core::kernels::ActiveMQXASessionKernel::isAutoAcknowledge ( ) const
virtual
virtual bool activemq::core::kernels::ActiveMQXASessionKernel::isTransacted ( ) const
virtual

Gets if the Sessions is a Transacted Session.

Returns
transacted true - false.
Exceptions
CMSException- If an internal error occurs.

Reimplemented from activemq::core::kernels::ActiveMQSessionKernel.

virtual void activemq::core::kernels::ActiveMQXASessionKernel::rollback ( )
virtual

Rolls back all messages done in this transaction and releases any locks currently held.

Exceptions
CMSException- If an internal error occurs.
IllegalStateException- if the method is not called by a transacted session.

Reimplemented from activemq::core::kernels::ActiveMQSessionKernel.


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