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
| Member | Description |
|---|---|
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
| Parameter | Description |
|---|---|
strPropertyFile | A 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
| Parameter | Description |
|---|---|
nConnType | A short integer representing the type of connection. |
strServerName | A string representing a server name or ip address. |
nPort | An integer representing a port number. |
nConnNum | An 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
| Parameter | Description |
|---|---|
strUser | A string representing a username. |
strPasswd | A 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
| Parameter | Description |
|---|---|
conn | A TEAgentConnection object to be released. |
void encrypt(TEAgent agent)
The encrypt method encrypts data.
Parameters
| Parameter | Description |
|---|---|
agent | A TEAgent object to be encrypted. |
void decrypt(TEAgent agent)
The decrypt method decrypts data.
Parameters
| Parameter | Description |
|---|---|
agent | A TEAgent object to be decrypted. |