@Override public void handleClose(Channel closed, IOException exception) { handler.shutdown(); try { handler.awaitCompletion(1, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { handler.shutdownNow(); } } });
@Override public void handleClose(Channel closed, IOException exception) { handler.shutdown(); try { handler.awaitCompletion(1, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { handler.shutdownNow(); } } });
channelAssociation.shutdownNow(); try { channelAssociation.awaitCompletion(1, TimeUnit.SECONDS);
channelAssociation.shutdownNow(); try { channelAssociation.awaitCompletion(1, TimeUnit.SECONDS);
@Override public void handleClose(Channel closed, IOException exception) { handler.shutdown(); boolean interrupted = false; try { if (!handler.awaitCompletion(CHANNEL_SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS)) { ControllerLogger.ROOT_LOGGER.gracefulManagementChannelHandlerShutdownTimedOut(CHANNEL_SHUTDOWN_TIMEOUT); } } catch (InterruptedException e) { interrupted = true; ControllerLogger.ROOT_LOGGER.gracefulManagementChannelHandlerShutdownFailed(e); } catch (Exception e) { ControllerLogger.ROOT_LOGGER.gracefulManagementChannelHandlerShutdownFailed(e); } finally { handler.shutdownNow(); if (interrupted) { Thread.currentThread().interrupt(); } } } });
@Override public void handleClose(Channel closed, IOException exception) { handler.shutdown(); boolean interrupted = false; try { if (!handler.awaitCompletion(CHANNEL_SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS)) { ROOT_LOGGER.gracefulManagementChannelHandlerShutdownTimedOut(CHANNEL_SHUTDOWN_TIMEOUT); } } catch (InterruptedException e) { interrupted = true; ROOT_LOGGER.serviceShutdownIncomplete(e); } catch (Exception e) { ROOT_LOGGER.serviceShutdownIncomplete(e); } finally { handler.shutdownNow(); if (interrupted) { Thread.currentThread().interrupt(); } } } });
@Override public void close() throws IOException { synchronized (this) { if(closed) { return; } closed = true; // Don't allow any new request channelAssociation.shutdown(); // First close the channel and connection if (strategy != null) { StreamUtils.safeClose(strategy); strategy = null; } // Then the endpoint if (endpoint != null) { StreamUtils.safeClose(endpoint); endpoint = null; } // Cancel all still active operations channelAssociation.shutdownNow(); try { channelAssociation.awaitCompletion(1, TimeUnit.SECONDS); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } finally { StreamUtils.safeClose(clientConfiguration); } } }
channelAssociation.shutdownNow(); try { channelAssociation.awaitCompletion(1, TimeUnit.SECONDS);