public final class ExecutorUtils
extends java.lang.Object
A utility class for ExecutorService.
| Modifier and Type | Method and Description |
|---|---|
static java.util.concurrent.ExecutorService |
daemonExecutor()
Creates an
ExecutorService where all Threads are
daemon threads and uncaught error aware. |
static java.util.concurrent.ScheduledExecutorService |
scheduledExecutor()
Creates a
ScheduledExecutorService where all Threads are
daemon threads and uncaught error aware. |
static void |
shutdownAndAwaitTermination(java.util.concurrent.ExecutorService pool,
int timeout)
Shuts down and awaits termination of an
ExecutorService. |
public static java.util.concurrent.ExecutorService daemonExecutor()
Creates an ExecutorService where all Threads are
daemon threads and uncaught error aware.
ExecutorService.public static java.util.concurrent.ScheduledExecutorService scheduledExecutor()
Creates a ScheduledExecutorService where all Threads are
daemon threads and uncaught error aware.
ScheduledExecutorService.public static void shutdownAndAwaitTermination(java.util.concurrent.ExecutorService pool,
int timeout)
Shuts down and awaits termination of an ExecutorService.
pool - the ExecutorServicetimeout - the timeout in seconds