Package com.db4o.foundation
Interface BlockingQueue4<T>
-
- All Superinterfaces:
Queue4<T>
- All Known Subinterfaces:
PausableBlockingQueue4<T>,TimeoutBlockingQueue4<T>
- All Known Implementing Classes:
BlockingQueue,DelegatingBlockingQueue,PausableBlockingQueue,TimeoutBlockingQueue
public interface BlockingQueue4<T> extends Queue4<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intdrainTo(Collection4<T> list)Removes all the available elements in the queue to the colletion passed as argument.Tnext(long timeout)Returns the next queued item or waits for it to be available for the maximum oftimeoutmiliseconds.voidstop()
-
-
-
Method Detail
-
next
T next(long timeout) throws BlockingQueueStoppedException
Returns the next queued item or waits for it to be available for the maximum of
timeoutmiliseconds.- Parameters:
timeout- maximum time to wait for the next avilable item in miliseconds- Returns:
- the next item or
nulliftimeoutis reached - Throws:
BlockingQueueStoppedException- if thestop()is called.
-
stop
void stop()
-
drainTo
int drainTo(Collection4<T> list) throws BlockingQueueStoppedException
Removes all the available elements in the queue to the colletion passed as argument.
It will block until at least one element is available.
- Parameters:
list-- Returns:
- the number of elements added to the list.
- Throws:
BlockingQueueStoppedException- if thestop()is called.
-
-