tyrex.resource.jdbc
final class ConnectionPool extends PoolMetrics implements Resource, DataSource, ConnectionEventListener, Runnable
Version: $Revision: 1.21 $
Field Summary | |
---|---|
static int | AVAILABLE
Flag that signifies that the pooled connection is available |
static int | CLOSED
Flag that signifies that the connection from the pooled
connection has been closed but the pooled connection is not
available |
static int | IN_USE
Flag that signifies that the pooled connection is not
available |
static int | TABLE_SIZE
The initial table size, unless a maximum number of connections
is specified. |
Category | _category
The category used for writing log information. |
Constructor Summary | |
---|---|
ConnectionPool(String name, PoolLimits limits, ClassLoader loader, XADataSource xaDataSource, ConnectionPoolDataSource poolDataSource, TyrexTransactionManager txManager, Category category) |
Method Summary | |
---|---|
void | connectionClosed(ConnectionEvent event) |
void | connectionErrorOccurred(ConnectionEvent event) |
void | destroy() |
protected long | expire()
Called periodically to expire connections that have been
available in the pool for longer than maxRetain seconds.
|
Object | getClientFactory() |
Class | getClientFactoryClass() |
Connection | getConnection() |
Connection | getConnection(String user, String password) |
int | getLoginTimeout() |
PrintWriter | getLogWriter() |
PoolLimits | getPoolLimits() |
PoolMetrics | getPoolMetrics() |
XAResource | getXAResource() |
boolean | release(PooledConnection pooled, boolean success)
Releases a connection. |
void | run() |
void | setLoginTimeout(int seconds) |
void | setLogWriter(PrintWriter logWriter) |
String | toString() |
Returns: The next expiration time, or zero if no connection is expected to expire soon.
This method returns true if the connection was used and is now available. It returns false if the connection was not found in the pool.
The XA resource, if available, is delisted from the transaction manager and dissociated from the thread context.
If success is false, it assumes the connection has been released due to an error. There is no need to discard a connection released with an error.
Parameters: pooled The pooled connection to release success True if the connection is useable, false if the connection is released due to an error
Returns: True if the connection has been released