activemq::cmsutil::SessionPool Class Reference

A pool of CMS sessions from the same connection and with the same acknowledge mode. More...

#include <src/main/activemq/cmsutil/SessionPool.h>

Public Member Functions

 SessionPool (cms::Connection *connection, cms::Session::AcknowledgeMode ackMode, ResourceLifecycleManager *resourceLifecycleManager)
 Constructs a session pool.
virtual ~SessionPool ()
 Destroys the pooled session objects, but not the underlying session resources.
virtual PooledSessiontakeSession ()
 Takes a session from the pool, creating one if necessary.
virtual void returnSession (PooledSession *session)
 Returns a session to the pool.
ResourceLifecycleManagergetResourceLifecycleManager ()

Detailed Description

A pool of CMS sessions from the same connection and with the same acknowledge mode.

Internal session resources are managed through a provided ResourceLifecycleManager, not by this pool. This class is thread-safe.


Constructor & Destructor Documentation

activemq::cmsutil::SessionPool::SessionPool ( cms::Connection connection,
cms::Session::AcknowledgeMode  ackMode,
ResourceLifecycleManager resourceLifecycleManager 
)

Constructs a session pool.

Parameters:
connection the connection to be used for creating all sessions.
ackMode the acknowledge mode to be used for all sessions
resourceLifecycleManager the object responsible for managing the lifecycle of any allocated cms::Session resources.
virtual activemq::cmsutil::SessionPool::~SessionPool (  )  [virtual]

Destroys the pooled session objects, but not the underlying session resources.

That is the job of the ResourceLifecycleManager.


Member Function Documentation

ResourceLifecycleManager* activemq::cmsutil::SessionPool::getResourceLifecycleManager (  )  [inline]
virtual void activemq::cmsutil::SessionPool::returnSession ( PooledSession session  )  [virtual]

Returns a session to the pool.

Parameters:
session the session to be returned.
virtual PooledSession* activemq::cmsutil::SessionPool::takeSession (  )  [virtual]

Takes a session from the pool, creating one if necessary.

Returns:
the pooled session object
Exceptions:
CMSException if an error occurred

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

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1