Q - type of queue item providedpublic class OneAtATimeQueueItemProvider<Q> extends java.lang.Object implements QueueItemProvider<Q>
QueueItemProvider which accepts any iterator and provides messages one at a time to a
QueueReader.| Constructor and Description |
|---|
OneAtATimeQueueItemProvider(java.util.Iterator<Q> items) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
java.util.Iterator<java.util.Collection<Q>> |
iterator()
Generally returns
this. |
java.util.Collection<Q> |
next() |
void |
remove()
A means to delete the message because it is done or should not be processed again.
|
public OneAtATimeQueueItemProvider(java.util.Iterator<Q> items)
public java.util.Iterator<java.util.Collection<Q>> iterator()
QueueItemProviderthis. QueueItemProviders are not generally reusable/resettable since the
underlying message source will often not be reversible. Mashing the two interfaces together simplifies
implementations a bit, and also supports any typical Iterable usage.iterator in interface QueueItemProvider<Q>iterator in interface java.lang.Iterable<java.util.Collection<Q>>public boolean hasNext()
hasNext in interface QueueItemProvider<Q>hasNext in interface java.util.Iterator<java.util.Collection<Q>>QueueReader should continue processing messages from this provider.public java.util.Collection<Q> next()
next in interface QueueItemProvider<Q>next in interface java.util.Iterator<java.util.Collection<Q>>null. The reading QueueReader may sleep after receiving an empty batch depending on its
configuration.public void remove()
QueueItemProviderremove in interface QueueItemProvider<Q>remove in interface java.util.Iterator<java.util.Collection<Q>>