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 long
getCompletedTasks()
ExecutionException
getFirstException()
long
getScheduledTasks()
boolean
isAllCompleted()
boolean
isExceptionThrown()
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()
void
waitUntilAllCompleted()
-
-
-
Constructor Detail
-
ExecutorAllCompletionService
public ExecutorAllCompletionService(Executor executor)
-
-
Method Detail
-
submit
public Future<Void> submit(Callable<Void> task)
- Specified by:
submit
in interfaceCompletionService<Void>
-
submit
public Future<Void> submit(Runnable task, Void result)
- Specified by:
submit
in 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:
take
in interfaceCompletionService<Void>
- Throws:
InterruptedException
-
poll
public Future<Void> poll()
- Specified by:
poll
in interfaceCompletionService<Void>
-
poll
public Future<Void> poll(long timeout, TimeUnit unit) throws InterruptedException
- Specified by:
poll
in interfaceCompletionService<Void>
- Throws:
InterruptedException
-
-