Package java.util.concurrent

Examples of java.util.concurrent.ExecutorService.shutdownNow()


      result.get();
    } finally {
      if (executor != null) {
        // interrupt the thread in case the test fails in the middle.
        // it has no effect if the thread is already terminated.
        executor.shutdownNow();
      }
      fs.delete(logDir, true);
    }
  }
View Full Code Here


                continue;
            }

            ExecutorService es = (ExecutorService) e;
            for (;;) {
                es.shutdownNow();
                try {
                    if (es.awaitTermination(1, TimeUnit.SECONDS)) {
                        break;
                    }
                } catch (InterruptedException ex) {
View Full Code Here

                    }
                }

                if (loop != null) {
                    loop.done = true;
                    executor.shutdownNow();
                    try {
                        for (;;) {
                            loop.selector.wakeup();
                            try {
                                if (executor.awaitTermination(1, TimeUnit.SECONDS)) {
View Full Code Here

      ExecutorService ex = Executors.newSingleThreadExecutor();
      KeyAffinityService kaf = KeyAffinityServiceFactory.newKeyAffinityService(cache, ex, new ByteKeyGenerator(), 2, true);
      Address address = cache.getAdvancedCache().getRpcManager().getTransport().getAddress();
      byte[] keyBytes = (byte[]) kaf.getKeyForAddress(address);
      String key = ByteKeyGenerator.getStringObject(keyBytes);
      ex.shutdownNow();
      kaf.stop();

      remoteCache.put(key, "v");
      assertOnlyServerHit(getAddress(hotRodServer2));
      TcpTransportFactory tcpTp = (TcpTransportFactory) TestingUtil.extractField(remoteCacheManager, "transportFactory");
View Full Code Here

    }

    List<Future<IStatus>> futures = null;
    try {
      futures = threadPool.invokeAll(callables);
      threadPool.shutdownNow();
      long endTime = System.currentTimeMillis();
      long timeInSec = (endTime - startTime) / 1000;
      long sec = timeInSec % 60;
      long min = (timeInSec - sec) / 60;
      LOGGER.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "computePathCost takes " + (endTime - startTime) + "ms (" + min + "m "
View Full Code Here

    {
      Thread.currentThread().interrupt();
    }
    finally
    {
      executor.shutdownNow();
    }
  }
 
  @Test
  public void primary()
View Full Code Here

    {
      Thread.currentThread().interrupt();
    }
    finally
    {
      executor.shutdownNow();
    }
  }
}
View Full Code Here

            throw new RuntimeException(e);
        } catch (ExecutionException e) {
            // by virtue of the Callable redefinition above I can cast
            throw new IOException(e);
        } finally {
            executor.shutdownNow();
            try {
                executor.awaitTermination(timeout, unit);
            } catch (InterruptedException e) {
                // ignore
            }
View Full Code Here

            throw new RuntimeException("Could not stop container", e);
        } finally {
            closeConnection();
            final ExecutorService exec = executor;
            if (exec != null) {
                exec.shutdownNow();
                executor = null;
            }
        }
    }
View Full Code Here

        result.get(2000, TimeUnit.MILLISECONDS);
      } catch (TimeoutException te) {
        // it is ok, expected.
      }
      waitForCounter(tot_mgr_wait_for_zk_delete, 0, 1, 10000);
      executor.shutdownNow();
      executor = null;

      // make sure the runnable is finished with no exception thrown.
      result.get();
    } finally {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.