OW_NAMESPACE::ClientCIMOMHandleConnectionPool Class Reference

This class is responsible for pooling ClientCIMOMHandleRef instances. More...

#include <OW_ClientCIMOMHandleConnectionPool.hpp>

Inheritance diagram for OW_NAMESPACE::ClientCIMOMHandleConnectionPool:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::ClientCIMOMHandleConnectionPool:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClientCIMOMHandleConnectionPool (unsigned maxConnectionsPerUrl)
ClientCIMOMHandleRef getConnection (const String &url)
 Get a new ClientCIMOMHandleRef connected to url.
void addConnectionToPool (const ClientCIMOMHandleRef &handle, const String &url)
 Add a ClientCIMOMHandleRef back to the pool.

Private Types

typedef std::multimap< String,
ClientCIMOMHandleRef
pool_t

Private Member Functions

 ClientCIMOMHandleConnectionPool (const ClientCIMOMHandleConnectionPool &)
ClientCIMOMHandleConnectionPooloperator= (const ClientCIMOMHandleConnectionPool &)

Private Attributes

unsigned m_maxConnectionsPerUrl
Mutex m_guard
pool_t m_pool

Classes

class  HandleReturner
 This class facilitates usage of RAII when using a ClientCIMOMHandleConnectionPool. More...

Detailed Description

This class is responsible for pooling ClientCIMOMHandleRef instances.

Each separate url is considered a different cimom. Connections are persistent.

Invariant: For each given url, a maximum of m_maxConnectionsPerUrl will be stored. Thread safety: read/write Copy semantics: Non-copyable Exception safety: Strong

Definition at line 61 of file OW_ClientCIMOMHandleConnectionPool.hpp.


Member Typedef Documentation

typedef std::multimap<String, ClientCIMOMHandleRef> OW_NAMESPACE::ClientCIMOMHandleConnectionPool::pool_t [private]
 

Definition at line 137 of file OW_ClientCIMOMHandleConnectionPool.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::ClientCIMOMHandleConnectionPool::ClientCIMOMHandleConnectionPool unsigned  maxConnectionsPerUrl  ) 
 

Parameters:
maxConnectionsPerUrl The maximum number of connections that may be stored for each given url.

Definition at line 45 of file OW_ClientCIMOMHandleConnectionPool.cpp.

OW_NAMESPACE::ClientCIMOMHandleConnectionPool::ClientCIMOMHandleConnectionPool const ClientCIMOMHandleConnectionPool  )  [private]
 


Member Function Documentation

void OW_NAMESPACE::ClientCIMOMHandleConnectionPool::addConnectionToPool const ClientCIMOMHandleRef handle,
const String url
 

Add a ClientCIMOMHandleRef back to the pool.

handle must be connected to url. If there are already m_maxConnectionsPerUrl ClientCIMOMHandleRef instances for url already in the pool, it won't be added to the pool. After calling this function, the caller can no longer use handle.

Parameters:
handle The ClientCIMOMHandleRef to add to the pool.
url The url handle is connected to.

Definition at line 70 of file OW_ClientCIMOMHandleConnectionPool.cpp.

References m_guard, m_maxConnectionsPerUrl, and m_pool.

Referenced by OW_NAMESPACE::ProviderAgentProviderEnvironment::~ProviderAgentProviderEnvironment().

ClientCIMOMHandleRef OW_NAMESPACE::ClientCIMOMHandleConnectionPool::getConnection const String url  ) 
 

Get a new ClientCIMOMHandleRef connected to url.

If there is one in the pool, it will be retrieved, otherwise a new connection will be created. The http protocol only authenticates when the connection is established, so each existing connection will already be authenticated. For this reason, the credentials should be part of the url, and a ClientAuthCBIFCRef will not be supplied to the ClientCIMOMHandleRef.

Parameters:
url The url.
Returns:
A ClientCIMOMHandleRef connected to url.
Exceptions:
MalformedURLException If the url is bad
std::bad_alloc 
SocketException If an SSL connection was requested, but support for SSL is not available.

Definition at line 52 of file OW_ClientCIMOMHandleConnectionPool.cpp.

References OW_NAMESPACE::ClientCIMOMHandle::createFromURL(), m_guard, and m_pool.

ClientCIMOMHandleConnectionPool& OW_NAMESPACE::ClientCIMOMHandleConnectionPool::operator= const ClientCIMOMHandleConnectionPool  )  [private]
 


Member Data Documentation

Mutex OW_NAMESPACE::ClientCIMOMHandleConnectionPool::m_guard [private]
 

Definition at line 130 of file OW_ClientCIMOMHandleConnectionPool.hpp.

Referenced by addConnectionToPool(), and getConnection().

unsigned OW_NAMESPACE::ClientCIMOMHandleConnectionPool::m_maxConnectionsPerUrl [private]
 

Definition at line 129 of file OW_ClientCIMOMHandleConnectionPool.hpp.

Referenced by addConnectionToPool().

pool_t OW_NAMESPACE::ClientCIMOMHandleConnectionPool::m_pool [private]
 

Definition at line 138 of file OW_ClientCIMOMHandleConnectionPool.hpp.

Referenced by addConnectionToPool(), and getConnection().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:13:19 2006 for openwbem by  doxygen 1.4.6