activemq::connector::stomp::StompSessionManager Class Reference

#include <StompSessionManager.h>

Inheritance diagram for activemq::connector::stomp::StompSessionManager:

activemq::connector::stomp::StompCommandListener List of all members.

Public Member Functions

 StompSessionManager (const std::string &connectionId, transport::Transport *transport)
virtual ~StompSessionManager (void)
virtual connector::SessionInfocreateSession (cms::Session::AcknowledgeMode ackMode) throw ( exceptions::ActiveMQException )
virtual void removeSession (connector::SessionInfo *session) throw ( exceptions::ActiveMQException )
virtual connector::ConsumerInfocreateConsumer (const cms::Destination *destination, SessionInfo *session, const std::string &selector) throw ( StompConnectorException )
virtual connector::ConsumerInfocreateDurableConsumer (const cms::Destination *destination, SessionInfo *session, const std::string &name, const std::string &selector, bool noLocal) throw ( StompConnectorException )
virtual void removeConsumer (connector::ConsumerInfo *consumer) throw ( StompConnectorException )
virtual void setConsumerMessageListener (ConsumerMessageListener *listener)
virtual void onStompCommand (commands::StompCommand *command) throw ( StompConnectorException )

Protected Member Functions

virtual void setSubscribeOptions (const cms::Destination *destination, commands::SubscribeCommand &command) throw ( StompConnectorException )
virtual unsigned int getNextSessionId (void)
virtual unsigned int getNextConsumerId (void)

Private Types

typedef std::map< unsigned
int, ConsumerInfo * > 
ConsumerMap
typedef std::map< std::string,
ConsumerMap
DestinationMap

Private Attributes

unsigned int nextSessionId
unsigned int nextConsumerId
concurrent::Mutex mutex
DestinationMap destinationMap
transport::Transporttransport
ConsumerMessageListenermessageListener
std::string connectionId

Detailed Description

The Stomp Session Manager is responsible for managing multiple Client Sessions. The management involves routing messages to sessions. If more than one ActiveMQConsumer is created that is listening to the same Topic or Queue, then the messages that are received must be delivered to each of those sessions, and copied so that a transactional session can manage the lifetime of the message.


Member Typedef Documentation

typedef std::map< unsigned int, ConsumerInfo* > activemq::connector::stomp::StompSessionManager::ConsumerMap [private]
 

typedef std::map< std::string, ConsumerMap > activemq::connector::stomp::StompSessionManager::DestinationMap [private]
 


Constructor & Destructor Documentation

StompSessionManager::StompSessionManager const std::string &  connectionId,
transport::Transport transport
 

StompSessionManager::~StompSessionManager void   )  [virtual]
 


Member Function Documentation

connector::ConsumerInfo * StompSessionManager::createConsumer const cms::Destination *  destination,
SessionInfo session,
const std::string &  selector
throw ( StompConnectorException ) [virtual]
 

Creates a new consumer to the specified session, will subscribe to the destination if another consumer hasn't already been subbed to that destination. The returned consumer is the owned by the caller and not deleted by this class.

Parameters:
destination to subscribe to
session to associate with
selector string
Returns:
new ConsumerInfo object.

connector::ConsumerInfo * StompSessionManager::createDurableConsumer const cms::Destination *  destination,
SessionInfo session,
const std::string &  name,
const std::string &  selector,
bool  noLocal
throw ( StompConnectorException ) [virtual]
 

Creates a new durable consumer to the specified session, will subscribe to the destination if another consumer hasn't already been subbed to that destination. The returned consumer is the owned by the caller and not deleted by this class.

Parameters:
destination Topic to subscribe to
session to associate with
name Subscription Name
selector string
noLocal Should we be notified of messages we send.
Returns:
new ConsumerInfo object.

connector::SessionInfo * StompSessionManager::createSession cms::Session::AcknowledgeMode  ackMode  )  throw ( exceptions::ActiveMQException ) [virtual]
 

Creates a new Session and returns a SessionInfo object whose lifetime is the property of the caller.

Parameters:
ackMode the ackMode of the session.
Returns:
new SessionInfo object

unsigned int StompSessionManager::getNextConsumerId void   )  [protected, virtual]
 

Gets the Next Session Id

Returns:
unique session id

unsigned int StompSessionManager::getNextSessionId void   )  [protected, virtual]
 

Gets the Next Session Id

Returns:
unique session id

void StompSessionManager::onStompCommand commands::StompCommand command  )  throw ( StompConnectorException ) [virtual]
 

Process the Stomp Command

Parameters:
command to process
Exceptions:
ConnterException 

Implements activemq::connector::stomp::StompCommandListener.

void StompSessionManager::removeConsumer connector::ConsumerInfo consumer  )  throw ( StompConnectorException ) [virtual]
 

Removes the Consumer from the session, will unsubscrive if the consumer is the only one listeneing on this destination. The Consumer is not deleted, just unassociated from the Manager caller is responsible for managing the lifetime.

Parameters:
consumer the ConsumerInfo for the consumer to remove
Exceptions:
ConnectorException 

void StompSessionManager::removeSession connector::SessionInfo session  )  throw ( exceptions::ActiveMQException ) [virtual]
 

removes the specified Session from the Manager, all data that is associated with session consumers is now lost. The session is not deleted here, it is the owner's responsibility.

Parameters:
session the session info for the session to remove.

virtual void activemq::connector::stomp::StompSessionManager::setConsumerMessageListener ConsumerMessageListener listener  )  [inline, virtual]
 

Sets the listener of consumer messages.

Parameters:
listener the observer.

void StompSessionManager::setSubscribeOptions const cms::Destination *  destination,
commands::SubscribeCommand command
throw ( StompConnectorException ) [protected, virtual]
 

Sets Subscribe Command options from the properties of a destination object.

Parameters:
destination The destination that we are subscribing to.
command The pending Subscribe command


Member Data Documentation

std::string activemq::connector::stomp::StompSessionManager::connectionId [private]
 

DestinationMap activemq::connector::stomp::StompSessionManager::destinationMap [private]
 

ConsumerMessageListener* activemq::connector::stomp::StompSessionManager::messageListener [private]
 

concurrent::Mutex activemq::connector::stomp::StompSessionManager::mutex [private]
 

unsigned int activemq::connector::stomp::StompSessionManager::nextConsumerId [private]
 

unsigned int activemq::connector::stomp::StompSessionManager::nextSessionId [private]
 

transport::Transport* activemq::connector::stomp::StompSessionManager::transport [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Aug 3 18:03:32 2006 for activemq-cpp by  doxygen 1.4.5