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 void
addToQueue(Object waitMonitor)
resource requesting thread will be added to queue
and the object on which it is made to wait is returnedprotected void
debug(String debugStatement)
Collection
getQueueContents()
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.int
getQueueLength()
returns the length of wait queueObject
peek()
returns (does not remove) the first object (resource request) from the queueObject
remove()
removes the first object (resource request) from the queueboolean
removeFromQueue(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:PoolWaitQueue
returns the length of wait queue- Specified by:
getQueueLength
in interfacePoolWaitQueue
- Returns:
- length of wait queue.
-
addToQueue
public void addToQueue(Object waitMonitor)
Description copied from interface:PoolWaitQueue
resource requesting thread will be added to queue
and the object on which it is made to wait is returned- Specified by:
addToQueue
in interfacePoolWaitQueue
- Parameters:
waitMonitor
- Object
-
removeFromQueue
public boolean removeFromQueue(Object o)
Description copied from interface:PoolWaitQueue
removes the specified object (resource request) from the queue- Specified by:
removeFromQueue
in interfacePoolWaitQueue
- Parameters:
o
- Object- Returns:
- boolean indicating whether the object was removed or not
-
remove
public Object remove()
Description copied from interface:PoolWaitQueue
removes the first object (resource request) from the queue- Specified by:
remove
in interfacePoolWaitQueue
- Returns:
- Object first object
-
peek
public Object peek()
Description copied from interface:PoolWaitQueue
returns (does not remove) the first object (resource request) from the queue- Specified by:
peek
in interfacePoolWaitQueue
- Returns:
- Object first object
-
getQueueContents
public Collection getQueueContents()
Description copied from interface:PoolWaitQueue
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.- Specified by:
getQueueContents
in interfacePoolWaitQueue
- Returns:
- Collection
-
debug
protected void debug(String debugStatement)
-
-