@Override protected final boolean isGracefulShutdownComplete() { return super.isGracefulShutdownComplete() && numBufferedStreams == 0; }
@Override protected final boolean isGracefulShutdownComplete() { return super.isGracefulShutdownComplete() && numBufferedStreams == 0; }
@Override protected final boolean isGracefulShutdownComplete() { return super.isGracefulShutdownComplete() && numBufferedStreams == 0; }
/** * Closes the connection if the graceful shutdown process has completed. * @param future Represents the status that will be passed to the {@link #closeListener}. */ private void checkCloseConnection(ChannelFuture future) { // If this connection is closing and the graceful shutdown has completed, close the connection // once this operation completes. if (closeListener != null && isGracefulShutdownComplete()) { ChannelFutureListener closeListener = this.closeListener; // This method could be called multiple times // and we don't want to notify the closeListener multiple times. this.closeListener = null; try { closeListener.operationComplete(future); } catch (Exception e) { throw new IllegalStateException("Close listener threw an unexpected exception", e); } } }
private void doGracefulShutdown(ChannelHandlerContext ctx, ChannelFuture future, ChannelPromise promise) { if (isGracefulShutdownComplete()) { // If there are no active streams, close immediately after the GO_AWAY write completes. future.addListener(new ClosingChannelFutureListener(ctx, promise)); } else { // If there are active streams we should wait until they are all closed before closing the connection. if (gracefulShutdownTimeoutMillis < 0) { closeListener = new ClosingChannelFutureListener(ctx, promise); } else { closeListener = new ClosingChannelFutureListener(ctx, promise, gracefulShutdownTimeoutMillis, MILLISECONDS); } } }
@Override protected final boolean isGracefulShutdownComplete() { return super.isGracefulShutdownComplete() && numBufferedStreams == 0; }
@Override protected final boolean isGracefulShutdownComplete() { return super.isGracefulShutdownComplete() && numBufferedStreams == 0; }
@Override protected final boolean isGracefulShutdownComplete() { return super.isGracefulShutdownComplete() && numBufferedStreams == 0; }
/** * Closes the connection if the graceful shutdown process has completed. * @param future Represents the status that will be passed to the {@link #closeListener}. */ private void checkCloseConnection(ChannelFuture future) { // If this connection is closing and the graceful shutdown has completed, close the connection // once this operation completes. if (closeListener != null && isGracefulShutdownComplete()) { ChannelFutureListener closeListener = this.closeListener; // This method could be called multiple times // and we don't want to notify the closeListener multiple times. this.closeListener = null; try { closeListener.operationComplete(future); } catch (Exception e) { throw new IllegalStateException("Close listener threw an unexpected exception", e); } } }
/** * Closes the connection if the graceful shutdown process has completed. * @param future Represents the status that will be passed to the {@link #closeListener}. */ private void checkCloseConnection(ChannelFuture future) { // If this connection is closing and the graceful shutdown has completed, close the connection // once this operation completes. if (closeListener != null && isGracefulShutdownComplete()) { ChannelFutureListener closeListener = this.closeListener; // This method could be called multiple times // and we don't want to notify the closeListener multiple times. this.closeListener = null; try { closeListener.operationComplete(future); } catch (Exception e) { throw new IllegalStateException("Close listener threw an unexpected exception", e); } } }
private void doGracefulShutdown(ChannelHandlerContext ctx, ChannelFuture future, ChannelPromise promise) { if (isGracefulShutdownComplete()) { // If there are no active streams, close immediately after the GO_AWAY write completes. future.addListener(new ClosingChannelFutureListener(ctx, promise)); } else { // If there are active streams we should wait until they are all closed before closing the connection. if (gracefulShutdownTimeoutMillis < 0) { closeListener = new ClosingChannelFutureListener(ctx, promise); } else { closeListener = new ClosingChannelFutureListener(ctx, promise, gracefulShutdownTimeoutMillis, MILLISECONDS); } } }
private void doGracefulShutdown(ChannelHandlerContext ctx, ChannelFuture future, ChannelPromise promise) { if (isGracefulShutdownComplete()) { // If there are no active streams, close immediately after the GO_AWAY write completes. future.addListener(new ClosingChannelFutureListener(ctx, promise)); } else { // If there are active streams we should wait until they are all closed before closing the connection. if (gracefulShutdownTimeoutMillis < 0) { closeListener = new ClosingChannelFutureListener(ctx, promise); } else { closeListener = new ClosingChannelFutureListener(ctx, promise, gracefulShutdownTimeoutMillis, MILLISECONDS); } } }