test_class.file: dubbo-common/src/test/java/com/alibaba/dubbo/common/utils/ExecutorUtilTest.java
test_class.identifier: ExecutorUtilTest
test_case.body: @Test
      public void testShutdownNow() throws Exception {
          ExecutorService executor = Mockito.mock(ExecutorService.class);
          when(executor.isTerminated()).thenReturn(false, true);
          ExecutorUtil.shutdownNow(executor, 20);
          verify(executor).shutdownNow();
          verify(executor).awaitTermination(20, TimeUnit.MILLISECONDS);
      }
test_case.class_method_signature: ExecutorUtilTest.testShutdownNow()
test_case.full_signature: @Test public void testShutdownNow()
test_case.identifier: testShutdownNow
test_case.invocations: mock thenReturn when isTerminated shutdownNow shutdownNow verify awaitTermination verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testShutdownNow()
focal_class.declarator: logger = LoggerFactory.getLogger(ExecutorUtil.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ExecutorUtil.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: shutdownExecutor = new ThreadPoolExecutor(0, 1,
              0L, TimeUnit.MILLISECONDS,
              new LinkedBlockingQueue<Runnable>(100),
              new NamedThreadFactory("Close-ExecutorService-Timer", true))
focal_class.modifier: private static final
focal_class.original_string: private static final ThreadPoolExecutor shutdownExecutor = new ThreadPoolExecutor(0, 1,
              0L, TimeUnit.MILLISECONDS,
              new LinkedBlockingQueue<Runnable>(100),
              new NamedThreadFactory("Close-ExecutorService-Timer", true));
focal_class.type: ThreadPoolExecutor
focal_class.var_name: shutdownExecutor
focal_class.file: dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ExecutorUtil.java
focal_class.identifier: ExecutorUtil
focal_class.class_method_signature: ExecutorUtil.isTerminated(Executor executor)
focal_class.full_signature: public static boolean isTerminated(Executor executor)
focal_class.identifier: isTerminated
focal_class.modifiers: public static
focal_class.parameters: (Executor executor)
focal_class.return: boolean
focal_class.signature: boolean isTerminated(Executor executor)
focal_class.class_method_signature: ExecutorUtil.gracefulShutdown(Executor executor, int timeout)
focal_class.full_signature: public static void gracefulShutdown(Executor executor, int timeout)
focal_class.identifier: gracefulShutdown
focal_class.modifiers: public static
focal_class.parameters: (Executor executor, int timeout)
focal_class.return: void
focal_class.signature: void gracefulShutdown(Executor executor, int timeout)
focal_class.class_method_signature: ExecutorUtil.shutdownNow(Executor executor, final int timeout)
focal_class.full_signature: public static void shutdownNow(Executor executor, final int timeout)
focal_class.identifier: shutdownNow
focal_class.modifiers: public static
focal_class.parameters: (Executor executor, final int timeout)
focal_class.return: void
focal_class.signature: void shutdownNow(Executor executor, final int timeout)
focal_class.class_method_signature: ExecutorUtil.newThreadToCloseExecutor(final ExecutorService es)
focal_class.full_signature: private static void newThreadToCloseExecutor(final ExecutorService es)
focal_class.identifier: newThreadToCloseExecutor
focal_class.modifiers: private static
focal_class.parameters: (final ExecutorService es)
focal_class.return: void
focal_class.signature: void newThreadToCloseExecutor(final ExecutorService es)
focal_class.class_method_signature: ExecutorUtil.setThreadName(URL url, String defaultName)
focal_class.full_signature: public static URL setThreadName(URL url, String defaultName)
focal_class.identifier: setThreadName
focal_class.modifiers: public static
focal_class.parameters: (URL url, String defaultName)
focal_class.return: URL
focal_class.signature: URL setThreadName(URL url, String defaultName)
focal_method.body: public static void shutdownNow(Executor executor, final int timeout) {
          if (!(executor instanceof ExecutorService) || isTerminated(executor)) {
              return;
          }
          final ExecutorService es = (ExecutorService) executor;
          try {
              es.shutdownNow();
          } catch (SecurityException ex2) {
              return;
          } catch (NullPointerException ex2) {
              return;
          }
          try {
              es.awaitTermination(timeout, TimeUnit.MILLISECONDS);
          } catch (InterruptedException ex) {
              Thread.currentThread().interrupt();
          }
          if (!isTerminated(es)) {
              newThreadToCloseExecutor(es);
          }
      }
focal_method.class_method_signature: ExecutorUtil.shutdownNow(Executor executor, final int timeout)
focal_method.full_signature: public static void shutdownNow(Executor executor, final int timeout)
focal_method.identifier: shutdownNow
focal_method.invocations: isTerminated shutdownNow awaitTermination interrupt currentThread isTerminated newThreadToCloseExecutor
focal_method.modifiers: public static
focal_method.parameters: (Executor executor, final int timeout)
focal_method.return: void
focal_method.signature: void shutdownNow(Executor executor, final int timeout)