public class ShutdownThreadsHelper extends Object
Threads and ExecutorServices.| Constructor and Description |
|---|
ShutdownThreadsHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
shutdownExecutorService(ExecutorService service)
shutdownExecutorService.
|
static boolean |
shutdownExecutorService(ExecutorService service,
long timeoutInMs)
shutdownExecutorService.
|
static boolean |
shutdownThread(Thread thread) |
static boolean |
shutdownThread(Thread thread,
long timeoutInMilliSeconds) |
public static boolean shutdownThread(Thread thread)
thread - to be shutdownpublic static boolean shutdownThread(Thread thread, long timeoutInMilliSeconds)
thread - to be shutdowntimeoutInMilliSeconds - time to wait for thread to join after being
interruptedpublic static boolean shutdownExecutorService(ExecutorService service) throws InterruptedException
service - to be shutdownInterruptedException - if the thread is interrupted.public 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.InterruptedException - if the thread is interrupted.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.