Package 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>
ACompletionService
that orders the completed tasks in the same order as they where submitted.
-
-
Constructor Summary
Constructors Constructor Description SubmitOrderedCompletionService(Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<V>
poll()
Future<V>
poll(long timeout, TimeUnit unit)
Future<V>
submit(Runnable task, Object result)
Future<V>
submit(Callable<V> task)
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.
-
-
-
Constructor Detail
-
SubmitOrderedCompletionService
public SubmitOrderedCompletionService(Executor executor)
-
-
Method Detail
-
submit
public Future<V> submit(Callable<V> task)
- Specified by:
submit
in interfaceCompletionService<V>
-
submit
public Future<V> submit(Runnable task, Object result)
- Specified by:
submit
in interfaceCompletionService<V>
-
take
public Future<V> take() throws InterruptedException
- Specified by:
take
in interfaceCompletionService<V>
- Throws:
InterruptedException
-
poll
public Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
poll
in interfaceCompletionService<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.
-
-