te::da::ConnectionPoolManager Class Reference

A singleton for managing the connection pools available in the system. More...

#include <ConnectionPoolManager.h>

Inheritance diagram for te::da::ConnectionPoolManager:
te::common::Singleton< ConnectionPoolManager >

Public Member Functions

void add (AbstractConnectionPool *pool)
 It adds the given pool to the list of monitored pools. More...
 
bool isInitialized () const
 It returns true if the manager was already started. More...
 
void monitore ()
 This static method encapsulates the execution thread that monitores all the pools. More...
 
void remove (AbstractConnectionPool *pool)
 It removes (un-register) the pool from the monitoring list. More...
 
void start ()
 It starts a new thread of execution that will monitore all the connection pools. More...
 
void stop ()
 It stops the connection pools monitoring thread. More...
 

Static Public Member Functions

static ConnectionPoolManagergetInstance ()
 It returns a reference to the singleton instance. More...
 

Protected Member Functions

 ConnectionPoolManager ()
 Singleton constructor is protected. More...
 
 ~ConnectionPoolManager ()
 Singleton destructor is protected. More...
 

Private Attributes

bool m_initialized
 A flag that indicates if the manager is monitoring the pools. More...
 
boost::mutex m_mtx
 A mutex to lock the manager access. More...
 
std::vector< AbstractConnectionPool * > m_pools
 The list of monitored pools. More...
 
boost::thread m_thread
 The monitoring thread. More...
 

Friends

class te::common::Singleton< ConnectionPoolManager >
 

Detailed Description

A singleton for managing the connection pools available in the system.

See also
AbstractConnectionPool

Definition at line 53 of file ConnectionPoolManager.h.

Constructor & Destructor Documentation

te::da::ConnectionPoolManager::ConnectionPoolManager ( )
protected

Singleton constructor is protected.

te::da::ConnectionPoolManager::~ConnectionPoolManager ( )
protected

Singleton destructor is protected.

Member Function Documentation

void te::da::ConnectionPoolManager::add ( AbstractConnectionPool pool)

It adds the given pool to the list of monitored pools.

Parameters
poolThe pool to be monitored.
static ConnectionPoolManager & te::common::Singleton< ConnectionPoolManager >::getInstance ( )
staticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.
bool te::da::ConnectionPoolManager::isInitialized ( ) const

It returns true if the manager was already started.

Returns
True if the manager was already started and are monitoring the pools.
void te::da::ConnectionPoolManager::monitore ( )

This static method encapsulates the execution thread that monitores all the pools.

Note
This method will be excuted every x seconds.
void te::da::ConnectionPoolManager::remove ( AbstractConnectionPool pool)

It removes (un-register) the pool from the monitoring list.

Parameters
poolThe pool to be removed from the monitoring list.
void te::da::ConnectionPoolManager::start ( )

It starts a new thread of execution that will monitore all the connection pools.

void te::da::ConnectionPoolManager::stop ( )

It stops the connection pools monitoring thread.

Friends And Related Function Documentation

Definition at line 55 of file ConnectionPoolManager.h.

Member Data Documentation

bool te::da::ConnectionPoolManager::m_initialized
private

A flag that indicates if the manager is monitoring the pools.

Definition at line 108 of file ConnectionPoolManager.h.

boost::mutex te::da::ConnectionPoolManager::m_mtx
private

A mutex to lock the manager access.

Definition at line 106 of file ConnectionPoolManager.h.

std::vector<AbstractConnectionPool*> te::da::ConnectionPoolManager::m_pools
private

The list of monitored pools.

Definition at line 105 of file ConnectionPoolManager.h.

boost::thread te::da::ConnectionPoolManager::m_thread
private

The monitoring thread.

Definition at line 107 of file ConnectionPoolManager.h.


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