Class ExecutorServices

java.lang.Object
org.apache.logging.log4j.core.util.ExecutorServices

public class ExecutorServices extends Object
  • Constructor Details

    • ExecutorServices

      public ExecutorServices()
  • Method Details

    • shutdown

      public static boolean shutdown(ExecutorService executorService, long timeout, TimeUnit timeUnit, String source)
      Shuts down the given 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.

      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 argument
      source - use this string in any log messages.
      Returns:
      true if the given executor terminated and false if 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.