public class SubmitOrderedCompletionService<V> extends Object implements CompletionService<V>
CompletionService that orders the completed tasks
in the same order as they where submitted.| Constructor and Description |
|---|
SubmitOrderedCompletionService(Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
Future<V> |
poll() |
Future<V> |
poll(long timeout,
TimeUnit unit) |
Future<V> |
submit(Callable<V> task) |
Future<V> |
submit(Runnable task,
Object result) |
Future<V> |
take() |
void |
timeoutTask()
Marks the current task as timeout, which allows you to poll the next
tasks which may already have been completed.
|
public SubmitOrderedCompletionService(Executor executor)
public Future<V> submit(Callable<V> task)
submit in interface CompletionService<V>public Future<V> submit(Runnable task, Object result)
submit in interface CompletionService<V>public Future<V> take() throws InterruptedException
take in interface CompletionService<V>InterruptedExceptionpublic Future<V> poll()
poll in interface CompletionService<V>public Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface CompletionService<V>InterruptedExceptionpublic void timeoutTask()
Apache Camel