Class ExecutorServices
- java.lang.Object
-
- org.apache.logging.log4j.core.util.ExecutorServices
-
public class ExecutorServices extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ExecutorServices()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidensureInitialized()no-op method which can be invoked to ensure this class has been initialized per jls-12.4.2.static booleanshutdown(java.util.concurrent.ExecutorService executorService, long timeout, java.util.concurrent.TimeUnit timeUnit, java.lang.String source)Shuts down the givenExecutorServicein an orderly fashion.
-
-
-
Field Detail
-
LOGGER
private static final Logger LOGGER
-
-
Method Detail
-
shutdown
public static boolean shutdown(java.util.concurrent.ExecutorService executorService, long timeout, java.util.concurrent.TimeUnit timeUnit, java.lang.String source)Shuts down the givenExecutorServicein 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.
- Parameters:
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.- Returns:
trueif the given executor terminated andfalseif the timeout elapsed before termination.
-
ensureInitialized
public static void ensureInitialized()
no-op method which can be invoked to ensure this class has been initialized per jls-12.4.2.
-
-