public class ShutdownThreadsHelper extends Object
Thread
s and ExecutorService
s.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 ShutdownThreadsHelper()
public static boolean shutdownThread(Thread thread)
thread
- to be shutdown
InterruptedException
public static boolean shutdownThread(Thread thread, long timeoutInMilliSeconds)
thread
- to be shutdown
timeoutInMilliSeconds
- time to wait for thread to join after being
interruptedInterruptedException
public static boolean shutdownExecutorService(ExecutorService service) throws InterruptedException
service
- to be shutdown
InterruptedException
public static boolean shutdownExecutorService(ExecutorService service, long timeoutInMs) throws InterruptedException
service
- to be shutdown
timeoutInMs
- time to wait for ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit)
calls in milli seconds.InterruptedException
Copyright © 2017 Apache Software Foundation. All Rights Reserved.