Class ExecutorUtil

java.lang.Object
org.apache.dubbo.common.utils.ExecutorUtil

public class ExecutorUtil extends Object
  • Constructor Details

    • ExecutorUtil

      public ExecutorUtil()
  • Method Details

    • isTerminated

      public static boolean isTerminated(Executor executor)
    • isShutdown

      public static boolean isShutdown(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
      Parameters:
      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
      Returns:
      new url with updated thread name
    • cancelScheduledFuture

      public static void cancelScheduledFuture(ScheduledFuture<?> scheduledFuture)