Skip to main content

ERUCES::TEConnectionPool

#include <teconnectionpool.h>

The TEConnectionPool class is for.

Private Attrib

TypeNameDescription
TEConnectionPoolImpl *m_impl

Public Member Functions

MemberDescription
TEConnectionPool(bool bSynchronize, size_t nMaxSize, size_t nMinSize)
~TEConnectionPool()The TEConnectionPool is the class destructor.
void attachContext(TEAuthenticationContext &ctx)The attachContext method is to attach a TEAuthenticationContext object.
void add(TEConnection *pConn)The add method is to add a TEConnection object.
void remove(TEConnection *pConn)The remove method removes a TEConnection object.
TEConnection * checkout()The checkout method retrieves an idle connection.
void checkin(TEConnection *pConn)The checkin method releases a connection and it becomes idle.
void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort, TEAuthenticationContext &ctx)The start method opens all connections in the pool with provided authentication context.
void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort)
void shutdown()The shutdown method closes all connections in the pool.
bool exist(TEConnection *pConn)
bool exist(uint32_t nHandle)The exist method checks the existence of connection object by providing the connection handle.
size_t size()The size method retrieves the current size of the pool.
size_t getMaxSize()The getMaxSizee method retrieves the maximum size of the pool.
size_t getMinSize()The getMinSize method retrieves the minimum size of the pool.
void expend(size_t nSize)

Private Func

MemberDescription
TEConnectionPool(const TEConnectionPool &)

Member Function Documentation

TEConnectionPool(bool bSynchronize, size_t nMaxSize, size_t nMinSize)

The TEConnectionPool constructor will construct a pool with given size.

Parameters

ParameterDescription
bSynchronizeA boolean representing
nMaxSizeAn integer representing the maximum size.
nMinSizeAn integer representing the minimum size.

~TEConnectionPool()

The TEConnectionPool is the class destructor.

void attachContext(TEAuthenticationContext &ctx)

The attachContext method is to attach a TEAuthenticationContext object.

Parameters

ParameterDescription
ctxA TEAuthenticationContext object representing

void add(TEConnection *pConn)

The add method is to add a TEConnection object.

Parameters

ParameterDescription
pConnA TEConnection object representing the connection object.

void remove(TEConnection *pConn)

The remove method removes a TEConnection object.

Parameters

ParameterDescription
pConnA TEConnection object representing the connection object.

TEConnection * checkout()

The checkout method retrieves an idle connection.

void checkin(TEConnection *pConn)

The checkin method releases a connection and it becomes idle.

Parameters

ParameterDescription
pConnA TEConnection object representing the connection object.

void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort, TEAuthenticationContext &ctx)

The start method opens all connections in the pool with provided authentication context.

Parameters

ParameterDescription
nTypeAn integer representing the
strServerA string representing the Key Server name or IP address.
nPortAn integer representing the Key Service port number.
ctxA TEAuthenticationContext object representing

void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort)

The start method opens all connections in the pool with an internal authentication context.

Parameters

ParameterDescription
nTypeAn integer representing the
strServerA string representing the Key Server name or IP address.
nPortAn integer representing the Key Service port number.

void shutdown()

The shutdown method closes all connections in the pool.

bool exist(TEConnection *pConn)

The exist method checks the existence of connection object by providing the connection object. @param pConn A TEConnection object representing the connection object.

Returns: A boolean representing whether on not the TEConnection object exists. True = exists.

bool exist(uint32_t nHandle)

The exist method checks the existence of connection object by providing the connection handle.

Parameters

ParameterDescription
nHandleAn integer representing the connection handle.

Returns: A boolean representing whether on not the TEConnection object exists. True = exists.

size_t size()

The size method retrieves the current size of the pool.

Returns: An integer representing the size of the pool.

size_t getMaxSize()

The getMaxSizee method retrieves the maximum size of the pool.

Returns: An integer representing the maximum size of the pool.

size_t getMinSize()

The getMinSize method retrieves the minimum size of the pool.

Returns: An integer representing the minimum size of the pool.

void expend(size_t nSize)

The expend method expends the maximum size of the pool.

Parameters

ParameterDescription
nSizeAn integer representing the maximum size of the connection pool.