|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.util.concurrent.SquadExecutor<T>
T - The futures' result typepublic class SquadExecutor<T>
An Executor which executes tasks through a delegate ExecutorService. The awaitCompletion()
methods waits until all tasks of the squad are complete.
| Constructor Summary | |
|---|---|
SquadExecutor(java.util.concurrent.ExecutorService delegate)
|
|
| Method Summary | |
|---|---|
java.util.List<java.util.concurrent.Future<T>> |
awaitCompletion()
Returns when all tasks that were previously submitted with submit(Callable), submit(Runnable,
Object), submit(Runnable, Object) and execute(Runnable) have completed. |
java.util.List<java.util.concurrent.Future<T>> |
awaitCompletion(long timeout,
java.util.concurrent.TimeUnit unit)
Returns when all tasks that were previously submitted with submit(Callable), submit(Runnable,
Object), submit(Runnable, Object) and execute(Runnable) have completed, or when then
timeout expires. |
void |
execute(java.lang.Runnable command)
|
java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task)
Submits a value-returning task for execution. |
java.util.concurrent.Future<T> |
submit(java.lang.Runnable task)
Submits a Runnable task for execution. |
java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result)
Submits a Runnable task for execution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SquadExecutor(java.util.concurrent.ExecutorService delegate)
SquadExecutor| Method Detail |
|---|
public void execute(java.lang.Runnable command)
execute in interface java.util.concurrent.Executorpublic java.util.concurrent.Future<T> submit(java.lang.Runnable task)
Runnable task for execution.
task - The task to submit
public java.util.concurrent.Future<T> submit(java.lang.Runnable task,
T result)
task - The task to submitresult - The result to return
public java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
task - The task to submit
public java.util.List<java.util.concurrent.Future<T>> awaitCompletion()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.CancellationException
submit(Callable), submit(Runnable,
Object), submit(Runnable, Object) and execute(Runnable) have completed.
java.util.concurrent.CancellationException - One of the tasks was cancelled
java.util.concurrent.ExecutionException - One of the tasks threw an exception
java.lang.InterruptedException - The current thread was interrupted while waiting
public java.util.List<java.util.concurrent.Future<T>> awaitCompletion(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.util.concurrent.CancellationException,
java.util.concurrent.ExecutionException,
java.lang.InterruptedException
submit(Callable), submit(Runnable,
Object), submit(Runnable, Object) and execute(Runnable) have completed, or when then
timeout expires.
java.util.concurrent.CancellationException - One of the tasks was cancelled
java.util.concurrent.ExecutionException - One of the tasks threw an exception
java.lang.InterruptedException - The current thread was interrupted while waiting
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||