@Immutable public final class ExecutorServiceHelper extends Object
ExecutorService with additional helper methods.| Modifier and Type | Method and Description |
|---|---|
static EInterrupt |
shutdownAndWaitUntilAllTasksAreFinished(ExecutorService aES)
Call shutdown on the
ExecutorService and wait indefinitely until it
terminated. |
static EInterrupt |
shutdownAndWaitUntilAllTasksAreFinished(ExecutorService aES,
long nTimeout,
TimeUnit eUnit)
Call shutdown on the
ExecutorService and wait indefinitely until it
terminated. |
static EInterrupt |
waitUntilAllTasksAreFinished(ExecutorService aES)
Wait indefinitely on the
ExecutorService until it terminates. |
static EInterrupt |
waitUntilAllTasksAreFinished(ExecutorService aES,
long nTimeout,
TimeUnit eUnit)
Wait indefinitely on the
ExecutorService until it terminates. |
@Nonnull public static EInterrupt waitUntilAllTasksAreFinished(@Nonnull ExecutorService aES)
ExecutorService until it terminates.aES - The ExecutorService to operate on. May not be
null.EInterrupt.INTERRUPTED if the executor service was
interrupted while awaiting termination. Never null.@Nonnull public static EInterrupt waitUntilAllTasksAreFinished(@Nonnull ExecutorService aES, @Nonnegative long nTimeout, @Nonnull TimeUnit eUnit)
ExecutorService until it terminates.aES - The ExecutorService to operate on. May not be
null.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)
ExecutorService and wait indefinitely until it
terminated.aES - The ExecutorService to operate on. May not be
null.EInterrupt.INTERRUPTED if the executor service was
interrupted while awaiting termination. Never null.@Nonnull public static EInterrupt shutdownAndWaitUntilAllTasksAreFinished(@Nonnull ExecutorService aES, @Nonnegative long nTimeout, @Nonnull TimeUnit eUnit)
ExecutorService and wait indefinitely until it
terminated.aES - The ExecutorService to operate on. May not be
null.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.Copyright © 2014–2017 Philip Helger. All rights reserved.