Package org.jvnet.hk2.config
Class WorkManager
java.lang.Object
org.jvnet.hk2.config.WorkManager
- All Implemented Interfaces:
Executor
Simple helper for managing work sent to a foreign executor service.
Has similarities to Fork and Join.
The implementation is designed such that Tasks-1 are sent to the executor
service for possibly another thread to handle. The last task is executed
by the caller thread so that all threads are attempted to be fully utilized
for processing including the caller's thread.
- Author:
- Jeff Trent
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidawaitCompletion(long timeout, TimeUnit unit) protected voidvoidvoidexecuteAll(Collection<Runnable> tasks) int<V> Future<V> <V> Collection<Future<V>> submitAll(Collection<Callable<V>> tasks)
-
Constructor Details
-
WorkManager
-
WorkManager
-
-
Method Details
-
getWorkInProgressCount
public int getWorkInProgressCount() -
awaitCompletion
public void awaitCompletion() -
awaitCompletion
- Throws:
TimeoutException
-
completed
-
submitAll
-
executeAll
-
submit
-
execute
-