Interface PoolWaitQueue
-
- All Known Implementing Classes:
DefaultPoolWaitQueue
public interface PoolWaitQueue
Represents the pool wait queue
To plug-in multiple implementation of wait-queue- Author:
- Jagadish Ramu
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_WAIT_QUEUE
static String
THREAD_PRIORITY_BASED_WAIT_QUEUE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addToQueue(Object o)
resource requesting thread will be added to queue
and the object on which it is made to wait is returnedCollection
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
-
DEFAULT_WAIT_QUEUE
static final String DEFAULT_WAIT_QUEUE
- See Also:
- Constant Field Values
-
THREAD_PRIORITY_BASED_WAIT_QUEUE
static final String THREAD_PRIORITY_BASED_WAIT_QUEUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getQueueLength
int getQueueLength()
returns the length of wait queue- Returns:
- length of wait queue.
-
addToQueue
void addToQueue(Object o)
resource requesting thread will be added to queue
and the object on which it is made to wait is returned- Parameters:
o
- Object
-
removeFromQueue
boolean removeFromQueue(Object o)
removes the specified object (resource request) from the queue- Parameters:
o
- Object- Returns:
- boolean indicating whether the object was removed or not
-
remove
Object remove()
removes the first object (resource request) from the queue- Returns:
- Object first object
-
peek
Object peek()
returns (does not remove) the first object (resource request) from the queue- Returns:
- Object first object
-
getQueueContents
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.- Returns:
- Collection
-
-