Class DefaultPoolWaitQueue
- java.lang.Object
-
- com.sun.enterprise.resource.pool.waitqueue.DefaultPoolWaitQueue
-
- All Implemented Interfaces:
PoolWaitQueue
public class DefaultPoolWaitQueue extends Object implements PoolWaitQueue
Default wait queue for the connection pool- Author:
- Jagadish Ramu
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger_logger-
Fields inherited from interface com.sun.enterprise.resource.pool.waitqueue.PoolWaitQueue
DEFAULT_WAIT_QUEUE, THREAD_PRIORITY_BASED_WAIT_QUEUE
-
-
Constructor Summary
Constructors Constructor Description DefaultPoolWaitQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToQueue(Object waitMonitor)resource requesting thread will be added to queue
and the object on which it is made to wait is returnedprotected voiddebug(String debugStatement)CollectiongetQueueContents()used to get access to the list of waiting clients
Useful in case of rolling over from one pool to another eg: transparent-dynamic-pool-reconfiguration.intgetQueueLength()returns the length of wait queueObjectpeek()returns (does not remove) the first object (resource request) from the queueObjectremove()removes the first object (resource request) from the queuebooleanremoveFromQueue(Object o)removes the specified object (resource request) from the queue
-
-
-
Field Detail
-
_logger
protected static final Logger _logger
-
-
Method Detail
-
getQueueLength
public int getQueueLength()
Description copied from interface:PoolWaitQueuereturns the length of wait queue- Specified by:
getQueueLengthin interfacePoolWaitQueue- Returns:
- length of wait queue.
-
addToQueue
public void addToQueue(Object waitMonitor)
Description copied from interface:PoolWaitQueueresource requesting thread will be added to queue
and the object on which it is made to wait is returned- Specified by:
addToQueuein interfacePoolWaitQueue- Parameters:
waitMonitor- Object
-
removeFromQueue
public boolean removeFromQueue(Object o)
Description copied from interface:PoolWaitQueueremoves the specified object (resource request) from the queue- Specified by:
removeFromQueuein interfacePoolWaitQueue- Parameters:
o- Object- Returns:
- boolean indicating whether the object was removed or not
-
remove
public Object remove()
Description copied from interface:PoolWaitQueueremoves the first object (resource request) from the queue- Specified by:
removein interfacePoolWaitQueue- Returns:
- Object first object
-
peek
public Object peek()
Description copied from interface:PoolWaitQueuereturns (does not remove) the first object (resource request) from the queue- Specified by:
peekin interfacePoolWaitQueue- Returns:
- Object first object
-
getQueueContents
public Collection getQueueContents()
Description copied from interface:PoolWaitQueueused to get access to the list of waiting clients
Useful in case of rolling over from one pool to another eg: transparent-dynamic-pool-reconfiguration.- Specified by:
getQueueContentsin interfacePoolWaitQueue- Returns:
- Collection
-
debug
protected void debug(String debugStatement)
-
-