public abstract class AbstractConnectionStrategy extends Object implements ConnectionStrategy, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected BoneCP |
pool
Pool handle
|
protected Lock |
terminationLock
Prevent repeated termination of all connections when the DB goes down.
|
| Constructor and Description |
|---|
AbstractConnectionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupConnection(ConnectionHandle oldHandle,
ConnectionHandle newHandle)
Give a chance to do some cleanups before closing off the connection.
|
Connection |
getConnection()
Obtains a connection using the configured strategy.
|
protected abstract Connection |
getConnectionInternal()
Actual call that returns a connection
|
ConnectionHandle |
pollConnection()
Obtains a connection using the configured strategy without blocking.
|
protected void |
postConnection(ConnectionHandle handle,
long statsObtainTime)
After obtaining a connection, perform additional tasks.
|
protected long |
preConnection()
Prep for a new connection
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitterminateAllConnectionsprotected BoneCP pool
protected Lock terminationLock
protected long preConnection()
throws SQLException
SQLExceptionprotected void postConnection(ConnectionHandle handle, long statsObtainTime)
handle - statsObtainTime - public Connection getConnection() throws SQLException
ConnectionStrategygetConnection in interface ConnectionStrategySQLException - on errorprotected abstract Connection getConnectionInternal() throws SQLException
SQLExceptionpublic ConnectionHandle pollConnection()
ConnectionStrategypollConnection in interface ConnectionStrategypublic void cleanupConnection(ConnectionHandle oldHandle, ConnectionHandle newHandle)
ConnectionStrategycleanupConnection in interface ConnectionStrategyCopyright © 2009-2013 JolBox. All Rights Reserved.