Skip to main content

com.eruces.teagent.TEAgentConnectionPool

The TEAgentConnectionPool class creates a connection pool.

Multiple property files may be used to create multiple connection pools.

Public Member Functions

MemberDescription
TEAgentConnectionPool()The TEAgentConnectionPool constructor is the default constructor.
TEAgentConnectionPool(String strPropertyFile)The TEAgentConnectionPool constructor specifies a property file name.
synchronized void setServer(short nConnType, String strServerName, int nPort, int nConnNum)The setServer method sets server connection information.
synchronized void connect(String strUser, String strPasswd)The connect method connects to a server using a username and password.
synchronized void reset()The reset method resets the connection pool.
synchronized TEAgentConnection getConnection()The getConnection method gets a connection instance from a connection pool.
synchronized void releaseConnection(TEAgentConnection conn)The releaseConnection method releases a used connection back to the connection pool.
void encrypt(TEAgent agent)The encrypt method encrypts data.
void decrypt(TEAgent agent)The decrypt method decrypts data.

Member Function Documentation

TEAgentConnectionPool()

The TEAgentConnectionPool constructor is the default constructor.

TEAgentConnectionPool(String strPropertyFile)

The TEAgentConnectionPool constructor specifies a property file name.

Parameters

ParameterDescription
strPropertyFileA string representing the name of a property file.

synchronized void setServer(short nConnType, String strServerName, int nPort, int nConnNum)

The setServer method sets server connection information.

Parameters

ParameterDescription
nConnTypeA short integer representing the type of connection.
strServerNameA string representing a server name or ip address.
nPortAn integer representing a port number.
nConnNumAn integer representing the number of connections.

synchronized void connect(String strUser, String strPasswd)

The connect method connects to a server using a username and password.

Parameters

ParameterDescription
strUserA string representing a username.
strPasswdA string representing a password.

synchronized void reset()

The reset method resets the connection pool.

synchronized TEAgentConnection getConnection()

The getConnection method gets a connection instance from a connection pool.

Returns: Returns a TEAgentConnection object; null if no connection is available.

synchronized void releaseConnection(TEAgentConnection conn)

The releaseConnection method releases a used connection back to the connection pool.

Parameters

ParameterDescription
connA TEAgentConnection object to be released.

void encrypt(TEAgent agent)

The encrypt method encrypts data.

Parameters

ParameterDescription
agentA TEAgent object to be encrypted.

void decrypt(TEAgent agent)

The decrypt method decrypts data.

Parameters

ParameterDescription
agentA TEAgent object to be decrypted.