@ParametersAreNonnullByDefault public final class MoreThreads extends Object
Thread instances.| Modifier and Type | Method and Description |
|---|---|
static void |
executeAtExit(Runnable task)
Adds a shutdown hook that will execute the
task when the application will exit. |
static ThreadFactory |
newThreadFactory()
Creates a new
ThreadFactory that creates daemon threads. |
static ThreadFactory |
newThreadFactory(String prefix)
Creates a new
ThreadFactory that creates daemon threads with a defined prefixed name. |
@Nonnull public static ThreadFactory newThreadFactory()
ThreadFactory that creates daemon threads.newThreadFactory(String)@Nonnull public static ThreadFactory newThreadFactory(@Nullable String prefix)
ThreadFactory that creates daemon threads with a defined prefixed name.prefix - the prefix of the name of created threads; if null the default name will be usedExecutors.defaultThreadFactory()public static void executeAtExit(Runnable task)
task when the application will exit.task - the task to executeNullPointerException - if the task is nullCopyright © 2017–2019 Atlanmod. All rights reserved.