public class ExternalQueueItemProvider<Q> extends java.lang.Object implements QueueItemProvider<Q>, java.io.Closeable
| Constructor and Description |
|---|
ExternalQueueItemProvider() |
ExternalQueueItemProvider(java.util.concurrent.BlockingQueue<Q> queue,
java.lang.Long pollTimeout,
java.util.concurrent.TimeUnit pollTimeUnit) |
ExternalQueueItemProvider(java.lang.Long pollTimeout,
java.util.concurrent.TimeUnit pollTimeUnit) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasNext() |
java.util.Iterator<java.util.Collection<Q>> |
iterator()
Generally returns
this. |
java.util.List<Q> |
next() |
void |
put(Q q) |
void |
remove()
A means to delete the message because it is done or should not be processed again.
|
public ExternalQueueItemProvider()
public ExternalQueueItemProvider(java.lang.Long pollTimeout,
java.util.concurrent.TimeUnit pollTimeUnit)
public ExternalQueueItemProvider(java.util.concurrent.BlockingQueue<Q> queue, java.lang.Long pollTimeout, java.util.concurrent.TimeUnit pollTimeUnit)
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.List<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>>public void put(Q q) throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException