Package org.infinispan.executors
Class ExecutorAllCompletionService
- java.lang.Object
-
- org.infinispan.executors.ExecutorAllCompletionService
-
- All Implemented Interfaces:
java.util.concurrent.CompletionService<java.lang.Void>
public class ExecutorAllCompletionService extends java.lang.Object implements java.util.concurrent.CompletionService<java.lang.Void>Exectues given tasks in provided executor.- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Constructor Summary
Constructors Constructor Description ExecutorAllCompletionService(java.util.concurrent.Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCompletedTasks()java.util.concurrent.ExecutionExceptiongetFirstException()longgetScheduledTasks()booleanisAllCompleted()booleanisExceptionThrown()java.util.concurrent.Future<java.lang.Void>poll()java.util.concurrent.Future<java.lang.Void>poll(long timeout, java.util.concurrent.TimeUnit unit)java.util.concurrent.Future<java.lang.Void>submit(java.lang.Runnable task, java.lang.Void result)java.util.concurrent.Future<java.lang.Void>submit(java.util.concurrent.Callable<java.lang.Void> task)java.util.concurrent.Future<java.lang.Void>take()voidwaitUntilAllCompleted()
-
-
-
Method Detail
-
submit
public java.util.concurrent.Future<java.lang.Void> submit(java.util.concurrent.Callable<java.lang.Void> task)
- Specified by:
submitin interfacejava.util.concurrent.CompletionService<java.lang.Void>
-
submit
public java.util.concurrent.Future<java.lang.Void> submit(java.lang.Runnable task, java.lang.Void result)- Specified by:
submitin interfacejava.util.concurrent.CompletionService<java.lang.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 java.util.concurrent.ExecutionException getFirstException()
-
take
public java.util.concurrent.Future<java.lang.Void> take() throws java.lang.InterruptedException- Specified by:
takein interfacejava.util.concurrent.CompletionService<java.lang.Void>- Throws:
java.lang.InterruptedException
-
poll
public java.util.concurrent.Future<java.lang.Void> poll()
- Specified by:
pollin interfacejava.util.concurrent.CompletionService<java.lang.Void>
-
poll
public java.util.concurrent.Future<java.lang.Void> poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Specified by:
pollin interfacejava.util.concurrent.CompletionService<java.lang.Void>- Throws:
java.lang.InterruptedException
-
-