예제 #1
0
    private boolean shutdown(long timeout, TimeUnit unit) throws InterruptedException {

      if (!isShutdown.compareAndSet(false, true)) return true;

      long start = System.nanoTime();
      boolean success = true;
      for (HostConnectionPool pool : pools.values())
        success &= pool.shutdown(timeout - Cluster.timeSince(start, unit), unit);
      return success;
    }
예제 #2
0
    private void shutdown() {

      if (!isShutdown.compareAndSet(false, true)) return;

      for (HostConnectionPool pool : pools.values()) pool.shutdown();
    }