public class ShutdownThreadsHelper extends Object
Threads and ExecutorServices.| Constructor and Description |
|---|
ShutdownThreadsHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
shutdownExecutorService(ExecutorService service) |
static boolean |
shutdownExecutorService(ExecutorService service,
long timeoutInMs) |
static boolean |
shutdownThread(Thread thread) |
static boolean |
shutdownThread(Thread thread,
long timeoutInMilliSeconds) |
public static boolean shutdownThread(Thread thread)
thread - to be shutdownInterruptedExceptionpublic static boolean shutdownThread(Thread thread, long timeoutInMilliSeconds)
thread - to be shutdowntimeoutInMilliSeconds - time to wait for thread to join after being
interruptedInterruptedExceptionpublic static boolean shutdownExecutorService(ExecutorService service) throws InterruptedException
service - to be shutdownInterruptedExceptionpublic static boolean shutdownExecutorService(ExecutorService service, long timeoutInMs) throws InterruptedException
service - to be shutdowntimeoutInMs - time to wait for ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit)
calls in milli seconds.InterruptedExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.