|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.resource.PoolMetrics tyrex.resource.jdbc.ConnectionPool
Field Summary | |
(package private) Category |
_category
The category used for writing log information. |
(package private) static int |
AVAILABLE
Flag that signifies that the pooled connection is available |
(package private) static int |
CLOSED
Flag that signifies that the connection from the pooled connection has been closed but the pooled connection is not available |
(package private) 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. |
Fields inherited from class tyrex.resource.PoolMetrics |
_available, _total |
Constructor Summary | |
(package private) |
ConnectionPool(java.lang.String name,
PoolLimits limits,
java.lang.ClassLoader loader,
javax.sql.XADataSource xaDataSource,
javax.sql.ConnectionPoolDataSource poolDataSource,
TyrexTransactionManager txManager,
Category category)
|
Method Summary | |
void |
connectionClosed(javax.sql.ConnectionEvent event)
|
void |
connectionErrorOccurred(javax.sql.ConnectionEvent event)
|
void |
destroy()
Called to destory the resource once it is no longer in use. |
protected long |
expire()
Called periodically to expire connections that have been available in the pool for longer than maxRetain seconds. |
java.lang.Object |
getClientFactory()
Returns the client connection factory. |
java.lang.Class |
getClientFactoryClass()
Returns the client connection factory class. |
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String password)
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
PoolLimits |
getPoolLimits()
Returns the limits placed on the connection pool. |
PoolMetrics |
getPoolMetrics()
Returns the pool metrics. |
javax.transaction.xa.XAResource |
getXAResource()
Returns the XA resource interface. |
(package private) boolean |
release(javax.sql.PooledConnection pooled,
boolean success)
Releases a connection. |
void |
run()
|
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter logWriter)
|
java.lang.String |
toString()
|
Methods inherited from class tyrex.resource.PoolMetrics |
getAvailable, getCurrentUnused, getCurrentUsed, getTotal, getTotalCreated, getTotalDiscarded, getTotalErrors, getTotalUsed, getUnusedAvgDuration, getUsedAvgDuration, recordCreated, recordDiscard, recordError, recordUnusedDuration, recordUsedDuration, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final int AVAILABLE
static final int IN_USE
static final int CLOSED
public static final int TABLE_SIZE
final Category _category
Constructor Detail |
ConnectionPool(java.lang.String name, PoolLimits limits, java.lang.ClassLoader loader, javax.sql.XADataSource xaDataSource, javax.sql.ConnectionPoolDataSource poolDataSource, TyrexTransactionManager txManager, Category category) throws ResourceException
Method Detail |
public PoolMetrics getPoolMetrics()
Resource
getPoolMetrics
in interface Resource
public PoolLimits getPoolLimits()
Resource
getPoolLimits
in interface Resource
public java.lang.Object getClientFactory()
Resource
getClientFactory
in interface Resource
public java.lang.Class getClientFactoryClass()
Resource
getClientFactoryClass
in interface Resource
public java.lang.String toString()
public javax.transaction.xa.XAResource getXAResource()
Resource
getXAResource
in interface Resource
public void destroy()
Resource
The application server must render the connection factory inaccessible to the application before calling this method.
destroy
in interface Resource
public void run()
run
in interface java.lang.Runnable
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter()
getLogWriter
in interface javax.sql.DataSource
public void setLogWriter(java.io.PrintWriter logWriter)
setLogWriter
in interface javax.sql.DataSource
public int getLoginTimeout()
getLoginTimeout
in interface javax.sql.DataSource
public void setLoginTimeout(int seconds)
setLoginTimeout
in interface javax.sql.DataSource
public void connectionClosed(javax.sql.ConnectionEvent event)
connectionClosed
in interface javax.sql.ConnectionEventListener
public void connectionErrorOccurred(javax.sql.ConnectionEvent event)
connectionErrorOccurred
in interface javax.sql.ConnectionEventListener
boolean release(javax.sql.PooledConnection pooled, boolean success)
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.
pooled
- The pooled connection to releasesuccess
- True if the connection is useable, false if
the connection is released due to an error
protected long expire()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |