activemq-cpp-3.9.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. More... | |
virtual | ~SessionPool () |
Destroys the pooled session objects, but not the underlying session resources. More... | |
virtual PooledSession * | takeSession () |
Takes a session from the pool, creating one if necessary. More... | |
virtual void | returnSession (PooledSession *session) |
Returns a session to the pool. More... | |
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 |
Destroys the pooled session objects, but not the underlying session resources.
That is the job of the ResourceLifecycleManager.
|
inline |
|
virtual |
Returns a session to the pool.
session | the session to be returned. |
|
virtual |
Takes a session from the pool, creating one if necessary.
CMSException | if an error occurred |