Class ExecutorUtils

  • All Implemented Interfaces:
    Utils

    public abstract class ExecutorUtils
    extends java.lang.Object
    implements Utils
    Executor Utilities class
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    Executor, ExecutorService, Executors
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean shutdown​(java.util.concurrent.Executor executor)
      Shutdown Executor if it's not shutdown
      static boolean shutdown​(java.util.concurrent.ExecutorService executorService)
      Shutdown ExecutorService if it's not shutdown
      static void shutdownOnExit​(java.util.concurrent.Executor one, java.util.concurrent.Executor... others)
      Shutdown one or more executors on JVM exit
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • shutdownOnExit

        public static void shutdownOnExit​(java.util.concurrent.Executor one,
                                          java.util.concurrent.Executor... others)
        Shutdown one or more executors on JVM exit
        Parameters:
        one - One Executor
        others - the other executors
      • shutdown

        public static boolean shutdown​(java.util.concurrent.Executor executor)
        Shutdown Executor if it's not shutdown
        Parameters:
        executor - ExecutorService
        Returns:
        true if shutdown successfully, otherwise false
      • shutdown

        public static boolean shutdown​(java.util.concurrent.ExecutorService executorService)
        Shutdown ExecutorService if it's not shutdown
        Parameters:
        executorService - ExecutorService
        Returns:
        true if shutdown successfully, otherwise false