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