org.apache.camel.util.concurrent
Class SubmitOrderedCompletionService<V>

java.lang.Object
  extended by 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:

Constructor Summary
SubmitOrderedCompletionService(Executor executor)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubmitOrderedCompletionService

public SubmitOrderedCompletionService(Executor executor)
Method Detail

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