public enum ExecutorServiceUtil extends Enum<ExecutorServiceUtil>
| Modifier and Type | Method and Description |
|---|---|
static void |
shutdownAndWaitForTermination(ExecutorService executorService)
Shut down an executor service, wait 5 seconds for it to terminate
|
static void |
shutdownAndWaitForTermination(ExecutorService executorService,
long timeout,
TimeUnit unit)
Shut down an executor service, waiting for it to terminate
|
static void |
shutdownForciblyAndWaitForTermination(ExecutorService executorService)
Shut down an executor service, interrupting all threads, wait 5 seconds for it to terminate
|
static void |
shutdownForciblyAndWaitForTermination(ExecutorService executorService,
long timeout,
TimeUnit unit)
Shut down an executor service, interrupting all threads, wait for it to terminate
|
static ExecutorServiceUtil |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ExecutorServiceUtil[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static ExecutorServiceUtil[] values()
for (ExecutorServiceUtil c : ExecutorServiceUtil.values()) System.out.println(c);
public static ExecutorServiceUtil 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 void shutdownAndWaitForTermination(ExecutorService executorService, long timeout, TimeUnit unit)
executorService - The executor servicetimeout - The timeoutunit - The unit of the timeout argumentIllegalStateException - if it didn't terminatepublic static void shutdownAndWaitForTermination(ExecutorService executorService)
executorService - The executor serviceIllegalStateException - if it didn't terminate in timepublic static void shutdownForciblyAndWaitForTermination(ExecutorService executorService)
executorService - The executor serviceIllegalStateException - if it didn't terminate in timepublic static void shutdownForciblyAndWaitForTermination(ExecutorService executorService, long timeout, TimeUnit unit)
executorService - The executor servicetimeout - The timeoutunit - The unit of the timeout argumentIllegalStateException - if it didn't terminate in timeCopyright © 2023. All rights reserved.