Class CountingCompletionService<V>
java.lang.Object
java.util.concurrent.ExecutorCompletionService<V>
org.aksw.commons.util.concurrent.CountingCompletionService<V>
- Type Parameters:
V-
- All Implemented Interfaces:
CompletionService<V>
Source:
http://stackoverflow.com/questions/9987019/how-to-know-when-a-completionservice-is-finished-delivering-results
http://www.javaspecialists.eu/archive/Issue214.html
- Author:
- raven
-
Constructor Summary
ConstructorsConstructorDescriptionCountingCompletionService(Executor executor) CountingCompletionService(Executor executor, BlockingQueue<Future<V>> queue) -
Method Summary
-
Constructor Details
-
CountingCompletionService
-
CountingCompletionService
-
-
Method Details
-
submit
- Specified by:
submitin interfaceCompletionService<V>- Overrides:
submitin classExecutorCompletionService<V>
-
submit
- Specified by:
submitin interfaceCompletionService<V>- Overrides:
submitin classExecutorCompletionService<V>
-
take
- Specified by:
takein interfaceCompletionService<V>- Overrides:
takein classExecutorCompletionService<V>- Throws:
InterruptedException
-
poll
- Specified by:
pollin interfaceCompletionService<V>- Overrides:
pollin classExecutorCompletionService<V>
-
poll
- Specified by:
pollin interfaceCompletionService<V>- Overrides:
pollin classExecutorCompletionService<V>- Throws:
InterruptedException
-
getNumberOfCompletedTasks
public long getNumberOfCompletedTasks() -
getNumberOfSubmittedTasks
public long getNumberOfSubmittedTasks() -
hasUncompletedTasks
public boolean hasUncompletedTasks()
-