Sets the time to wait when close connection watch threads are enabled. 0 = wait forever.
@param closeConnectionWatchTimeout the watchTimeout to set
@param timeUnit Time granularity
779737
public void setCloseConnectionWatchTimeout(long closeConnectionWatchTimeout, TimeUnit timeUnit) {
		this.closeConnectionWatchTimeoutInMs = TimeUnit.MILLISECONDS.convert(closeConnectionWatchTimeout, timeUnit);
	}
611897
@Override
    public Configuration defaultTimeout(long time, TimeUnit unit) {
        return defaultTimeout(new Duration(time, unit));
    }
610718
public void setReadTimeout(int readTimeout) {
		this.client = this.client.newBuilder()
				.readTimeout(readTimeout, TimeUnit.MILLISECONDS)
				.build();
	}
228529
public void setReadTimeout(int timeout) {
		Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value");
		getHttpClient().getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeout);
	}
1100018
public final void waitForPort(final String portName, final int timeout, final TimeUnit unit) {
        final Binding binding = getPortBinding(portName);
        waitForPort(binding.getHost(), binding.getPort(), timeout, unit);
    }
368216
public void await(long weight, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
        barrier.await(weight, timeout, unit);
    }
241935
public SdkClientBuilder connectionCheckoutTimeout(long timeout, TimeUnit unit)
    {
        this.connectionCheckoutTimeoutMs = (int) TimeUnit.MILLISECONDS.convert(timeout, unit);
        return this;
    }
1044057
public Retryer<R> fixedWait(long sleepTime, TimeUnit timeUnit) {
        withWaitStrategy(fixedWaitStrategy(checkNotNull(timeUnit, "TimeUnit cannot be null").toMillis(sleepTime)));
        return this;
    }
1258149
public void setTimeout(ScheduledExecutorService timeoutExecutor, long timeout, TimeUnit unit) {
      cancelTimeoutTask();
      ScheduledFuture<Void> timeoutFuture = timeoutExecutor.schedule(this, timeout, unit);
      setTimeoutFuture(timeoutFuture);
   }
1085688
public void onConnectionClosed() {
        logger.debug("[onConnectionClosed] '{}', isConnected = {}", uri, isConnected());

        webSocketConnectionManager.stop();

        timer = new Timer();

        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                logger.debug("[onConnectionClosed:run]");

                synchronized (webSocketHandler.getNotifyConnectionObject()) {
                    webSocketConnectionManager.start();

                    try {
                        webSocketHandler.getNotifyConnectionObject().wait(TimeUnit.SECONDS.toMillis(WEBSOCKET_RECONNECT_TIMEOUT));
                    } catch (InterruptedException e) {
                        logger.debug("[onConnectionClose]", e);
                    }

                    if (isConnected()) {
                        logger.debug("[onConnectionClosed:run] connected");

                        clusterListener.onServerReconnected(getServerId(), uri);
                        this.cancel();
                    } else {
                        logger.debug("[onConnectionClosed:run] NOT connected");

                        webSocketConnectionManager.stop();
                    }
                }
            }
        }, TimeUnit.SECONDS.toMillis(WEBSOCKET_TIMEOUT), TimeUnit.SECONDS.toMillis(WEBSOCKET_RECONNECT_TIMEOUT));
    }
403126
@Override
    public void waitForValue(final long timeout, final TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
        synchronized (VALUE_LOCK) {
            if (value != null) {
                return;
            }
            // if 0 wait forever like the default java wait() implementation.
            if (timeUnit.toMillis(timeout) == 0) {
                VALUE_LOCK.wait();
            } else {
                timeUnit.timedWait(VALUE_LOCK, timeout);
            }
            if (value == null) {
                throw new NotAvailableException(Observable.class, new TimeoutException());
            }
        }

        //waitUntilNotificationIsFinished();
    }
58399
protected void joinSchedulerDriver(long timeout, TimeUnit unit) {
    // ExecutorService used to monitor whether close() completes in time
    ExecutorService service = Executors.newFixedThreadPool(1);
    final CountDownLatch closeLatch = new CountDownLatch(1);
    Runnable driverJoin = new Runnable() {
      @Override
      public void run() {
        driver.join();
        closeLatch.countDown();
      }
    };
    service.submit(driverJoin);

    LOG.info("Waiting for Mesos Driver got stopped");
    try {
      if (!closeLatch.await(timeout, unit)) {
        LOG.severe("Mesos Driver failed to stop in time.");
      } else {
        LOG.info("Mesos Driver stopped.");
      }
    } catch (InterruptedException e) {
      LOG.log(Level.SEVERE, "Close latch thread is interrupted: ", e);
    }

    // Shutdown the ExecutorService
    service.shutdownNow();
  }
543032
public void setConnectTimeout(int connectTimeout) {
		this.client = this.client.newBuilder()
				.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS)
				.build();
	}
261161
public void setTimeout(long timeout, TimeUnit unit)
    {
        this.timeout = TimeUnit.MILLISECONDS.convert(timeout, unit);
    }
402801
public boolean await(long waitDuration, TimeUnit timeUnit) throws InterruptedException {
    return sync.tryAcquireSharedNanos(0, timeUnit.toNanos(waitDuration));
  }
1361603
private void setTimeout(HttpURLConnection httpUrlConnection) {
		String connTimeout = Config.getProperty(Config.TIMEOUT_CONNECTION);
		if (StringUtils.hasText(connTimeout)) {
			httpUrlConnection.setReadTimeout(new Integer(connTimeout.trim()));			
		}
		String reqTimeout = Config.getProperty(Config.TIMEOUT_REQUEST);
		if (StringUtils.hasText(reqTimeout)) {
			httpUrlConnection.setConnectTimeout(new Integer(reqTimeout.trim()));			
		}
	}
577192
public BlockingListMaker<K, E> waitFor(long time, TimeUnit unit) {
        this.nanoTimeout = time == 0 ? 1 : NANOSECONDS.convert(time, unit);
        return this;
    }