activemq-cpp-3.4.0
|
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 PooledSession * | takeSession () |
Takes a session from the pool, creating one if necessary. | |
virtual void | returnSession (PooledSession *session) |
Returns a session to the pool. | |
ResourceLifecycleManager * | getResourceLifecycleManager () |
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.
activemq::cmsutil::SessionPool::SessionPool | ( | cms::Connection * | connection, |
cms::Session::AcknowledgeMode | ackMode, | ||
ResourceLifecycleManager * | resourceLifecycleManager | ||
) |
Constructs a session pool.
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.
ResourceLifecycleManager* activemq::cmsutil::SessionPool::getResourceLifecycleManager | ( | ) | [inline] |
virtual void activemq::cmsutil::SessionPool::returnSession | ( | PooledSession * | session | ) | [virtual] |
Returns a session to the pool.
session | the session to be returned. |
virtual PooledSession* activemq::cmsutil::SessionPool::takeSession | ( | ) | [virtual] |
Takes a session from the pool, creating one if necessary.
CMSException | if an error occurred |