Interface PoolWaitQueue
-
- All Known Implementing Classes:
DefaultPoolWaitQueue
public interface PoolWaitQueueRepresents the pool wait queue
To plug-in multiple implementation of wait-queue- Author:
- Jagadish Ramu
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_WAIT_QUEUEstatic StringTHREAD_PRIORITY_BASED_WAIT_QUEUE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddToQueue(Object o)resource requesting thread will be added to queue
and the object on which it is made to wait is returnedCollectiongetQueueContents()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
-
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
-
-