public enum Threads extends Enum<Threads>
| Modifier and Type | Method and Description |
|---|---|
static ExecutorService |
acquireExecutorService(String name,
int threads,
boolean daemon) |
static ScheduledExecutorService |
acquireScheduledExecutorService(String name,
boolean daemon) |
static void |
executorFactory(ExecutorFactory executorFactory) |
static void |
interrupt(ExecutorService service) |
static void |
renderStackTrace(StringBuilder stringBuilder,
StackTraceElement[] stackTraceElements)
Render a stack trace
|
static void |
shutdown(@NotNull ExecutorService service)
Shutdown a
ExecutorService. |
static void |
shutdown(@NotNull ExecutorService service,
boolean daemon) |
static void |
shutdownDaemon(@NotNull ExecutorService service)
Shutdown a daemon
ExecutorService. |
static @NotNull String |
threadGroupPrefix() |
static void |
unpark(ExecutorService service) |
static Threads |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Threads[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static Threads[] values()
for (Threads c : Threads.values()) System.out.println(c);
public static Threads valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static ExecutorService acquireExecutorService(String name, int threads, boolean daemon)
public static ScheduledExecutorService acquireScheduledExecutorService(String name, boolean daemon)
public static void executorFactory(ExecutorFactory executorFactory)
@NotNull public static @NotNull String threadGroupPrefix()
public static void shutdownDaemon(@NotNull
@NotNull ExecutorService service)
ExecutorService. We stop the service immediately as we want to
stop whatever is executing quicklyservice - servicepublic static void shutdown(@NotNull
@NotNull ExecutorService service,
boolean daemon)
public static void shutdown(@NotNull
@NotNull ExecutorService service)
ExecutorService. We assume that the service's tasks have already been told to
stop (e.g. running.set(false)) and that we can initially just wait (for SHUTDOWN_WAIT_MILLIS)
for the service to complete. If it does not stop by itself then we terminate it.service - servicepublic static void renderStackTrace(StringBuilder stringBuilder, StackTraceElement[] stackTraceElements)
stringBuilder - The string builder to render tostackTraceElements - The array of stack-trace elementspublic static void unpark(ExecutorService service)
public static void interrupt(ExecutorService service)
Copyright © 2024. All rights reserved.