Package org.opennms.core.ipc.sink.api
Interface DispatchQueue<T>
-
- All Known Implementing Classes:
QueueFileOffHeapDispatchQueue
public interface DispatchQueue<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DispatchQueue.EnqueueResult
The result of performing anenqueue(Object, String)
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map.Entry<java.lang.String,T>
dequeue()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.DispatchQueue.EnqueueResult
enqueue(T message, java.lang.String key)
Adds the message to the tail of the queue blocking if the queue is currently full.int
getSize()
boolean
isFull()
-
-
-
Method Detail
-
enqueue
DispatchQueue.EnqueueResult enqueue(T message, java.lang.String key) throws WriteFailedException
Adds the message to the tail of the queue blocking if the queue is currently full.- Throws:
WriteFailedException
-
dequeue
java.util.Map.Entry<java.lang.String,T> dequeue() throws java.lang.InterruptedException
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.- Throws:
java.lang.InterruptedException
- if interrupted while waiting
-
isFull
boolean isFull()
- Returns:
- true if the queue has no more capacity, false otherwise
-
getSize
int getSize()
- Returns:
- the current number of queued items
-
-