org.apache.camel.util.concurrent
Class SubmitOrderedCompletionService<V>
java.lang.Object
org.apache.camel.util.concurrent.SubmitOrderedCompletionService<V>
- All Implemented Interfaces:
- CompletionService<V>
public class SubmitOrderedCompletionService<V>
- extends Object
- implements CompletionService<V>
A CompletionService
that orders the completed tasks
in the same order as they where submitted.
- Version:
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SubmitOrderedCompletionService
public SubmitOrderedCompletionService(Executor executor)
submit
public Future<V> submit(Callable<V> task)
- Specified by:
submit
in interface CompletionService<V>
submit
public Future<V> submit(Runnable task,
Object result)
- Specified by:
submit
in interface CompletionService<V>
take
public Future<V> take()
throws InterruptedException
- Specified by:
take
in interface CompletionService<V>
- Throws:
InterruptedException
poll
public Future<V> poll()
- Specified by:
poll
in interface CompletionService<V>
poll
public Future<V> poll(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
poll
in interface CompletionService<V>
- Throws:
InterruptedException
timeoutTask
public void timeoutTask()
- Marks the current task as timeout, which allows you to poll the next
tasks which may already have been completed.
Apache CAMEL