|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--anvil.database.ConnectionAccessQueue
ConnectionAccessQueue is used by ConnectionManager
when acquiring connections from the pool. Queue handles the situations when connections
are not immediately available by letting threads to wait
for certain (limited) amount of time. Queue implements
ConnectionObserver through which the notifications
of available are made by the pool.
ConnectionManager,
ConnectionManager.acquire(String),
ConnectionPool,
ConnectionPool.acquire(int),
ConnectionObserver,
PooledConnection| Constructor Summary | |
ConnectionAccessQueue(ConnectionPool pool)
Constructs the queue. |
|
| Method Summary | |
PooledConnection |
acquire(int timeout)
Acquire the connection from the pool, waiting for only specified amount of time. |
void |
connectionsAvailable()
Notification from connection observer interface. |
ConnectionPool |
getPool()
Gets the connection pool of this queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConnectionAccessQueue(ConnectionPool pool)
pool - Connection pool| Method Detail |
public ConnectionPool getPool()
public PooledConnection acquire(int timeout)
throws CannotReturnPooledConnectionException
timeout - Timeout override (if > 0)
CannotReturnPooledConnectionException - If acquire timed outpublic void connectionsAvailable()
connectionsAvailable in interface ConnectionObserver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||