code: @Override
    public boolean shutdown(long timeout, TimeUnit unit) {
      // Guard against double shutdowns (bug 8).
      if (shuttingDown) {
        getLogger().info("Suppressing duplicate attempt to shut down");
        return false;
      }
      shuttingDown = true;
      String baseName = mconn.getName();
      mconn.setName(baseName + " - SHUTTING DOWN");
      boolean rv = true;
      if (connFactory.isDefaultExecutorService()) {
        try {
          executorService.shutdown();
        } catch (Exception ex) {
          getLogger().warn("Failed shutting down the ExecutorService: ", ex);
        }
      }
      try {
        // Conditionally wait
        if (timeout > 0) {
          mconn.setName(baseName + " - SHUTTING DOWN (waiting)");
          rv = waitForQueues(timeout, unit);
        }
      } finally {
        // But always begin the shutdown sequence
        try {
          mconn.setName(baseName + " - SHUTTING DOWN (telling client)");
          mconn.shutdown();
          mconn.setName(baseName + " - SHUTTING DOWN (informed client)");
          tcService.shutdown();
          //terminate all pending Auth Threads
          authMonitor.interruptAllPendingAuth();
        } catch (IOException e) {
          getLogger().warn("exception while shutting down", e);
        }
      }
      return rv;
    }
docs: Shut down this client gracefully.
  
  @param timeout the amount of time time for shutdown
  @param unit the TimeUnit for the timeout
  @return result of the shutdown request