@NotThreadSafe public final class ManagedExecutorService extends Object
ExecutorService with additional helper methods.| Constructor and Description |
|---|
ManagedExecutorService(ExecutorService aES) |
| Modifier and Type | Method and Description |
|---|---|
EInterrupt |
shutdownAndWaitUntilAllTasksAreFinished()
Call shutdown on the
ExecutorService and wait indefinitely until it
terminated. |
static EInterrupt |
shutdownAndWaitUntilAllTasksAreFinished(ExecutorService aES) |
static EInterrupt |
shutdownAndWaitUntilAllTasksAreFinished(ExecutorService aES,
long nTimeout,
TimeUnit eUnit) |
EInterrupt |
shutdownAndWaitUntilAllTasksAreFinished(long nTimeout,
TimeUnit eUnit)
Call shutdown on the
ExecutorService and wait indefinitely until it
terminated. |
EInterrupt |
waitUntilAllTasksAreFinished()
Wait indefinitely on the
ExecutorService until it terminates. |
EInterrupt |
waitUntilAllTasksAreFinished(long nTimeout,
TimeUnit eUnit)
Wait indefinitely on the
ExecutorService until it terminates. |
public ManagedExecutorService(@Nonnull ExecutorService aES)
@Nonnull public EInterrupt waitUntilAllTasksAreFinished()
ExecutorService until it terminates.EInterrupt.INTERRUPTED if the executor service was
interrupted while awaiting termination. Never null.@Nonnull public EInterrupt waitUntilAllTasksAreFinished(@Nonnegative long nTimeout, @Nonnull TimeUnit eUnit)
ExecutorService until it terminates.nTimeout - the maximum time to wait. Must be > 0.eUnit - the time unit of the timeout argument. Must not be null
.EInterrupt.INTERRUPTED if the executor service was
interrupted while awaiting termination. Never null.@Nonnull public EInterrupt shutdownAndWaitUntilAllTasksAreFinished()
ExecutorService and wait indefinitely until it
terminated.EInterrupt.INTERRUPTED if the executor service was
interrupted while awaiting termination. Never null.@Nonnull public EInterrupt shutdownAndWaitUntilAllTasksAreFinished(@Nonnegative long nTimeout, @Nonnull TimeUnit eUnit)
ExecutorService and wait indefinitely until it
terminated.nTimeout - the maximum time to wait. Must be > 0.eUnit - the time unit of the timeout argument. Must not be null
.EInterrupt.INTERRUPTED if the executor service was
interrupted while awaiting termination. Never null.@Nonnull public static EInterrupt shutdownAndWaitUntilAllTasksAreFinished(@Nonnull ExecutorService aES)
@Nonnull public static EInterrupt shutdownAndWaitUntilAllTasksAreFinished(@Nonnull ExecutorService aES, @Nonnegative long nTimeout, @Nonnull TimeUnit eUnit)
Copyright © 2014–2016 Philip Helger. All rights reserved.