public class ConnectionPartition extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected BoneCP |
pool
Handle to the pool.
|
protected ReentrantReadWriteLock |
statsLock
Statistics lock.
|
| Constructor and Description |
|---|
ConnectionPartition(BoneCP pool)
Partition constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFreeConnection(ConnectionHandle connectionHandle)
Adds a free connection.
|
protected int |
getAcquireIncrement() |
protected int |
getAvailableConnections()
Returns the number of avail connections
|
protected int |
getCreatedConnections() |
protected BlockingQueue<ConnectionHandle> |
getFreeConnections() |
protected int |
getMaxConnections() |
protected int |
getMinConnections() |
protected String |
getPassword() |
protected BlockingQueue<Object> |
getPoolWatchThreadSignalQueue()
Returns a handle to the poolWatchThreadSignalQueue
|
protected long |
getQueryExecuteTimeLimitinNanoSeconds()
Store the unit translation here to avoid recalculating it in the constructor of StatementHandle.
|
int |
getRemainingCapacity()
Returns no of free slots.
|
protected String |
getUrl() |
protected String |
getUsername() |
protected boolean |
isUnableToCreateMoreTransactions()
Returns true if we have created all the connections we can
|
protected void |
setFreeConnections(BlockingQueue<ConnectionHandle> freeConnections) |
protected void |
setUnableToCreateMoreTransactions(boolean unableToCreateMoreTransactions)
Sets connection creation possible status
|
String |
toString() |
protected void |
trackConnectionFinalizer(ConnectionHandle connectionHandle)
This method is a replacement for finalize() but avoids all its pitfalls (see Joshua Bloch et.
|
protected void |
updateCreatedConnections(int increment)
Updates leased connections statistics
|
protected ReentrantReadWriteLock statsLock
protected BoneCP pool
public ConnectionPartition(BoneCP pool)
pool - handle to connection poolprotected BlockingQueue<Object> getPoolWatchThreadSignalQueue()
protected void updateCreatedConnections(int increment)
increment - value to add/subtractprotected void addFreeConnection(ConnectionHandle connectionHandle) throws SQLException
connectionHandle - SQLException - on errorprotected void trackConnectionFinalizer(ConnectionHandle connectionHandle)
connectionHandle - handle to watchprotected BlockingQueue<ConnectionHandle> getFreeConnections()
protected void setFreeConnections(BlockingQueue<ConnectionHandle> freeConnections)
freeConnections - the freeConnections to setprotected int getAcquireIncrement()
protected int getMinConnections()
protected int getMaxConnections()
protected int getCreatedConnections()
protected String getUrl()
protected String getUsername()
protected String getPassword()
protected boolean isUnableToCreateMoreTransactions()
protected void setUnableToCreateMoreTransactions(boolean unableToCreateMoreTransactions)
unableToCreateMoreTransactions - t/fprotected int getAvailableConnections()
public int getRemainingCapacity()
protected long getQueryExecuteTimeLimitinNanoSeconds()
Copyright © 2009-2013 JolBox. All Rights Reserved.