public abstract class ConnectionPool extends java.lang.Object implements XPooledConnectionEventListener
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<XPooledConnection> |
connections |
| Constructor and Description |
|---|
ConnectionPool(ConnectionFactory connectionFactory,
ConnectionPoolProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotDestroyed() |
int |
availableSize()
The amount of pooled connections in state available.
|
Reapable |
borrowConnection()
Borrows a connection from the pool.
|
void |
destroy() |
protected void |
destroyPooledConnection(XPooledConnection xpc) |
protected Reapable |
findExistingOpenConnectionForCallingThread() |
protected Reapable |
findOrWaitForAnAvailableConnection() |
protected void |
logCurrentPoolSize() |
void |
onXPooledConnectionTerminated(XPooledConnection connection)
fired when a connection changed its state to terminated
|
void |
reapPool() |
protected Reapable |
recycleConnectionIfPossible() |
void |
refresh() |
protected Reapable |
retrieveFirstAvailableConnection() |
java.lang.String |
toString() |
int |
totalSize()
The total amount of pooled connections in any state.
|
protected java.util.List<XPooledConnection> connections
public ConnectionPool(ConnectionFactory connectionFactory, ConnectionPoolProperties properties) throws ConnectionPoolException
ConnectionPoolExceptionprotected void assertNotDestroyed()
throws ConnectionPoolException
ConnectionPoolExceptionprotected Reapable recycleConnectionIfPossible() throws java.lang.Exception
java.lang.Exceptionpublic Reapable borrowConnection() throws CreateConnectionException, PoolExhaustedException, ConnectionPoolException
CreateConnectionException - If the pool attempted to grow but failed.PoolExhaustedException - If the pool could not grow because it is exhausted.ConnectionPoolException - Other errors.protected Reapable findOrWaitForAnAvailableConnection() throws ConnectionPoolException
ConnectionPoolExceptionprotected Reapable findExistingOpenConnectionForCallingThread()
protected void logCurrentPoolSize()
protected Reapable retrieveFirstAvailableConnection()
protected void destroyPooledConnection(XPooledConnection xpc)
public void reapPool()
public void destroy()
public void refresh()
public int availableSize()
public int totalSize()
public void onXPooledConnectionTerminated(XPooledConnection connection)
XPooledConnectionEventListeneronXPooledConnectionTerminated in interface XPooledConnectionEventListenerpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018. All Rights Reserved.