Package org.infinispan.executors
Class ExecutorAllCompletionService
- java.lang.Object
-
- org.infinispan.executors.ExecutorAllCompletionService
-
- All Implemented Interfaces:
CompletionService<Void>
public class ExecutorAllCompletionService extends Object implements CompletionService<Void>
Exectues given tasks in provided executor.- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Constructor Summary
Constructors Constructor Description ExecutorAllCompletionService(Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCompletedTasks()ExecutionExceptiongetFirstException()longgetScheduledTasks()booleanisAllCompleted()booleanisExceptionThrown()Future<Void>poll()Future<Void>poll(long timeout, TimeUnit unit)Future<Void>submit(Runnable task, Void result)Future<Void>submit(Callable<Void> task)Future<Void>take()voidwaitUntilAllCompleted()
-
-
-
Constructor Detail
-
ExecutorAllCompletionService
public ExecutorAllCompletionService(Executor executor)
-
-
Method Detail
-
submit
public Future<Void> submit(Callable<Void> task)
- Specified by:
submitin interfaceCompletionService<Void>
-
submit
public Future<Void> submit(Runnable task, Void result)
- Specified by:
submitin interfaceCompletionService<Void>
-
isAllCompleted
public boolean isAllCompleted()
- Returns:
- True if all currently scheduled tasks have already been completed, false otherwise;
-
getScheduledTasks
public long getScheduledTasks()
-
getCompletedTasks
public long getCompletedTasks()
-
waitUntilAllCompleted
public void waitUntilAllCompleted()
-
isExceptionThrown
public boolean isExceptionThrown()
-
getFirstException
public ExecutionException getFirstException()
-
take
public Future<Void> take() throws InterruptedException
- Specified by:
takein interfaceCompletionService<Void>- Throws:
InterruptedException
-
poll
public Future<Void> poll()
- Specified by:
pollin interfaceCompletionService<Void>
-
poll
public Future<Void> poll(long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
pollin interfaceCompletionService<Void>- Throws:
InterruptedException
-
-