Esempio n. 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;
    }