|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.util.ThreadPoolUtils
public final class ThreadPoolUtils
Utility methods for working with thread pools ExecutorService.
| Field Summary | |
|---|---|
static long |
DEFAULT_SHUTDOWN_AWAIT_TERMINATION
|
| Constructor Summary | |
|---|---|
ThreadPoolUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
awaitTermination(ExecutorService executorService,
long shutdownAwaitTermination)
Awaits the termination of the thread pool. |
static void |
shutdown(ExecutorService executorService)
Shutdown the given executor service only (ie not graceful shutdown). |
static void |
shutdownGraceful(ExecutorService executorService)
Shutdown the given executor service graceful at first, and then aggressively if the await termination timeout was hit. |
static void |
shutdownGraceful(ExecutorService executorService,
long shutdownAwaitTermination)
Shutdown the given executor service graceful at first, and then aggressively if the await termination timeout was hit. |
static List<Runnable> |
shutdownNow(ExecutorService executorService)
Shutdown now the given executor service aggressively. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long DEFAULT_SHUTDOWN_AWAIT_TERMINATION
| Constructor Detail |
|---|
public ThreadPoolUtils()
| Method Detail |
|---|
public static void shutdown(ExecutorService executorService)
ExecutorService.shutdown()public static List<Runnable> shutdownNow(ExecutorService executorService)
executorService - the executor service to shutdown now
ExecutorService.shutdownNow()public static void shutdownGraceful(ExecutorService executorService)
shutdownGraceful(java.util.concurrent.ExecutorService, long)
with a timeout value of DEFAULT_SHUTDOWN_AWAIT_TERMINATION millis.
public static void shutdownGraceful(ExecutorService executorService,
long shutdownAwaitTermination)
shutdownNow(java.util.concurrent.ExecutorService) which
forces a shutdown. The parameter shutdownAwaitTermination
is used as timeout value waiting for orderly shutdown to
complete normally, before going aggressively.
executorService - the executor service to shutdownshutdownAwaitTermination - timeout in millis to wait for orderly shutdown
public static boolean awaitTermination(ExecutorService executorService,
long shutdownAwaitTermination)
throws InterruptedException
executorService - the thread poolshutdownAwaitTermination - time in millis to use as timeout
InterruptedException - is thrown if we are interrupted during the waiting
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||