public class ExecutorServices extends Object
Constructor and Description |
---|
ExecutorServices() |
Modifier and Type | Method and Description |
---|---|
static boolean |
shutdown(ExecutorService executorService,
long timeout,
TimeUnit timeUnit,
String source)
Shuts down the given
ExecutorService in an orderly fashion. |
public ExecutorServices()
public static boolean shutdown(ExecutorService executorService, long timeout, TimeUnit timeUnit, String source)
ExecutorService
in an orderly fashion. Disables new tasks from submission and then
waits for existing tasks to terminate. Eventually cancels running tasks if too much time elapses.
If the timeout is 0, then a plain shutdown takes place.
executorService
- the pool to shutdown.timeout
- the maximum time to wait, or 0 to not wait for existing tasks to terminate.timeUnit
- the time unit of the timeout argumentsource
- use this string in any log messages.true
if the given executor terminated and false
if the timeout elapsed before
termination.Copyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.