@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { this.restClient.shutdown(new FutureCallback<None>()); this.httpClientFactory.shutdown(new FutureCallback<None>()); } }
this._clientFactory.shutdown(factoryShutdownCallback, SHUTDOWN_TIMEOUT, TimeUnit.SECONDS); try { factoryShutdownCallback.get();
@AfterClass public void shutdown() throws Exception { if (_server != null) { _server.stop(); } if (_serverEngine != null) { _serverEngine.shutdown(); } if (_serverScheduler != null) { _serverScheduler.shutdownNow(); } for (Client client : _transportClients) { FutureCallback<None> callback = new FutureCallback<>(); client.shutdown(callback); callback.get(); } if (_clientFactory != null) { FutureCallback<None> callback = new FutureCallback<>(); _clientFactory.shutdown(callback); callback.get(); } }
/** * Initiates an orderly shutdown similar to * {@link #shutdown(com.linkedin.common.callback.Callback)}. However, in the case that * some clients fail to shutdown, the factory shutdown will still complete after the * specified timeout. * * @param callback invoked after all clients shutdown (or the timeout expires) and the * factory has shut down * @param timeout the timeout * @param timeoutUnit the timeout unit */ public void shutdown(Callback<None> callback, long timeout, TimeUnit timeoutUnit) { // Schedule a timeout in case shutdown does not happen normally _shutdownTimeoutTask = _executor.schedule(new Runnable() { @Override public void run() { LOG.warn("Shutdown timeout exceeded, proceeding with shutdown"); finishShutdown(); } }, timeout, timeoutUnit); // Initiate orderly shutdown shutdown(callback); }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { if (_restClient.isPresent()) { _restClient.get().shutdown(new FutureCallback<None>()); } if (_httpClientFactory.isPresent()) { _httpClientFactory.get().shutdown(new FutureCallback<None>()); } } }
@Override public void close() throws IOException { this.restClient.shutdown(new FutureCallback<None>()); this.httpClientFactory.shutdown(new FutureCallback<None>()); } }