类 ExecutorUtil


  • public class ExecutorUtil
    extends Object
    • 构造器详细资料

      • ExecutorUtil

        public ExecutorUtil()
    • 方法详细资料

      • isTerminated

        public static boolean isTerminated(Executor executor)
      • gracefulShutdown

        public static void gracefulShutdown(Executor executor,
                                            int timeout)
        Use the shutdown pattern from: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html
        参数:
        executor - the Executor to shutdown
        timeout - the timeout in milliseconds before termination
      • shutdownNow

        public static void shutdownNow(Executor executor,
                                       int timeout)
      • setThreadName

        public static URL setThreadName(URL url,
                                        String defaultName)
        append thread name with url address
        返回:
        new url with updated thread name