Package org.jboss.util.timeout
Interface TimeoutPriorityQueue
-
- All Known Implementing Classes:
HashedTimeoutPriorityQueueImpl
,TimeoutPriorityQueueImpl
public interface TimeoutPriorityQueue
TimeoutPriorityQueue.- Version:
- $Revision$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Cancels the queuevoid
clear()
Clears the queueTimeoutExt
offer(long time, TimeoutTarget target)
Add a timeout to the queueTimeoutExt
peek()
Retrieves but does not remove the top of the queue or null if there is no such elementTimeoutExt
poll()
Retrieves and removes the top of the queue if it times out or null if there is no such elementTimeoutExt
poll(long wait)
Retrieves and removes the top of the queue if it times out or null if there is no such elementboolean
remove(TimeoutExt timeout)
Removes the passed timeout from the queueint
size()
TimeoutExt
take()
Take a timeout when it times out
-
-
-
Method Detail
-
offer
TimeoutExt offer(long time, TimeoutTarget target)
Add a timeout to the queue- Parameters:
time
- the time of the timeouttarget
- the timeout target- Returns:
- timeout when it was added to the queue, false otherwise
-
take
TimeoutExt take()
Take a timeout when it times out- Returns:
- the top the queue or null if the queue is cancelled
-
poll
TimeoutExt poll()
Retrieves and removes the top of the queue if it times out or null if there is no such element- Returns:
- the top the queue or null if the queue is empty
-
poll
TimeoutExt poll(long wait)
Retrieves and removes the top of the queue if it times out or null if there is no such element- Parameters:
wait
- how to long to wait in milliseconds if the queue is empty- Returns:
- the top of the queue or null if the queue is empty
-
peek
TimeoutExt peek()
Retrieves but does not remove the top of the queue or null if there is no such element- Returns:
- the top of the queue or null if the queue is empty
-
remove
boolean remove(TimeoutExt timeout)
Removes the passed timeout from the queue- Parameters:
timeout
-- Returns:
- true when the timeout was removed
-
clear
void clear()
Clears the queue
-
cancel
void cancel()
Cancels the queue
-
size
int size()
- Returns:
- the size of the queue
-
-