|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.pool.ConnectionPool
This class implements a simple connection pooling scheme.
Nested Class Summary | |
protected class |
ConnectionPool.Monitor
Deprecated. This inner class monitors the PoolBrokerService . |
Field Summary | |
static int |
DEFAULT_CONNECTION_WAIT_TIMEOUT
Deprecated. Default Connect Wait Timeout: 10 Seconds |
static int |
DEFAULT_EXPIRY_TIME
Deprecated. Default Expiry Time for a pool: 1 hour |
static int |
DEFAULT_MAX_CONNECTIONS
Deprecated. Default maximum Number of connections from this pool: One |
Constructor Summary | |
(package private) |
ConnectionPool(javax.sql.ConnectionPoolDataSource cpds,
java.lang.String username,
java.lang.String password,
int maxConnections,
int expiryTime,
int connectionWaitTimeout,
int logInterval)
Deprecated. Creates a ConnectionPool with the default
attributes. |
Method Summary | |
void |
connectionClosed(javax.sql.ConnectionEvent event)
Deprecated. This will be called if the Connection returned by the getConnection method came from a PooledConnection, and the user calls the close() method of this connection object. |
void |
connectionErrorOccurred(javax.sql.ConnectionEvent event)
Deprecated. If a fatal error occurs, close the underlying physical connection so as not to be returned in the future |
(package private) void |
decrementConnections()
Deprecated. Decreases the count of connections in the pool and also calls notify() . |
protected void |
finalize()
Deprecated. Close any open connections when this object is garbage collected. |
(package private) javax.sql.PooledConnection |
getConnection(java.lang.String username,
java.lang.String password)
Deprecated. Returns a connection that maintains a link to the pool it came from. |
(package private) int |
getNbrAvailable()
Deprecated. Returns the available connections in the pool |
(package private) int |
getNbrCheckedOut()
Deprecated. Returns the checked out connections in the pool |
(package private) java.lang.String |
getPoolName()
Deprecated. Get the name of the pool |
(package private) int |
getTotalCount()
Deprecated. Returns the Total connections in the pool |
(package private) void |
shutdown()
Deprecated. Close all connections to the database, |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_MAX_CONNECTIONS
public static final int DEFAULT_EXPIRY_TIME
public static final int DEFAULT_CONNECTION_WAIT_TIMEOUT
Constructor Detail |
ConnectionPool(javax.sql.ConnectionPoolDataSource cpds, java.lang.String username, java.lang.String password, int maxConnections, int expiryTime, int connectionWaitTimeout, int logInterval)
ConnectionPool
with the default
attributes.
cpds
- The datasourceusername
- The user name for this pool.password
- The password for this pool.maxConnections
- max number of connectionsexpiryTime
- connection expiry timeconnectionWaitTimeout
- timeoutlogInterval
- log intervalMethod Detail |
final javax.sql.PooledConnection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
username
- The name of the database user.password
- The password of the database user.
java.sql.SQLException
- if there is aproblem with the db connectionprotected void finalize() throws java.lang.Throwable
java.lang.Throwable
- Anything might happen...void shutdown()
int getTotalCount()
int getNbrAvailable()
int getNbrCheckedOut()
void decrementConnections()
notify()
.
java.lang.String getPoolName()
public void connectionClosed(javax.sql.ConnectionEvent event)
connectionClosed
in interface javax.sql.ConnectionEventListener
event
- the connection eventpublic void connectionErrorOccurred(javax.sql.ConnectionEvent event)
connectionErrorOccurred
in interface javax.sql.ConnectionEventListener
event
- the connection event
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |