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 Thread s are
daemon threads and uncaught error aware. |
static java.util.concurrent.ScheduledExecutorService |
scheduledExecutor()
Creates a
ScheduledExecutorService where all Thread s 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 Thread
s are
daemon threads and uncaught error aware.
ExecutorService
.public static java.util.concurrent.ScheduledExecutorService scheduledExecutor()
Creates a ScheduledExecutorService
where all Thread
s 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 ExecutorService
timeout
- the timeout in seconds