@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { if (sslInitDone) { super.channelActive(ctx); } }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelInactive(ctx); ctx.close(); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof PushUserAuth) { authEvent = (PushUserAuth) evt; } super.userEventTriggered(ctx, evt); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (ctx.channel().attr(ATTR_CH_THROTTLED).get() != null) { // Discard this msg as channel is in process of being closed. } else { super.channelRead(ctx, msg); } }
@Override public final void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { logger.error("Exception caught, closing push channel for " + authEvent, cause); ctx.close(); super.exceptionCaught(ctx, cause); }
@Override public void channelUnregistered(final ChannelHandlerContext ctx) throws Exception { super.channelUnregistered(ctx); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { // Fire start event, and if that succeeded, then allow processing to // continue to next handler in pipeline. if (fireStartEvent(ctx, (HttpRequest) msg)) { super.channelRead(ctx, msg); } } else { super.channelRead(ctx, msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { connectionErrors.increment(); if (LOG.isInfoEnabled()) { LOG.info("Connection error caught. " + String.valueOf(cause), cause); } super.exceptionCaught(ctx, cause); }
@Override public void channelUnregistered(final ChannelHandlerContext ctx) throws Exception { SocketManager.getInstance().removeClient(ctx.channel()); super.channelUnregistered(ctx); }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { if (sslInitDone) { super.channelActive(ctx); } }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { if (maxConnections > 0) { connections.decrementAndGet(); } super.channelInactive(ctx); } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { super.userEventTriggered(ctx, evt); if (evt instanceof IdleStateEvent) { ctx.close(); } } }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { if (msg instanceof Http2Frame) { incrementCounter(registry, frameCounterName, metricId, (Http2Frame) msg); } } finally { super.channelRead(ctx, msg); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { passport(ctx).add(PassportState.ORIGIN_CH_EXCEPTION); super.exceptionCaught(ctx, cause); } }
@Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { if (inner == null) { super.channelUnregistered(ctx); } else { inner.channelUnregistered(ctx); } }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { // Store a ref to the count of current inflight requests onto this channel. So that // other code can query it using getInflightRequestCountFromChannel(). ctx.channel().attr(ATTR_CURRENT_REQS).set(currentRequests); super.channelActive(ctx); }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { removeInternalHandler(ctx); super.channelInactive(ctx); }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { if (evt instanceof ChannelInputShutdownEvent) { // The decodeLast method is invoked when a channelInactive event is encountered. // This method is responsible for ending requests in some situations and must be called // when the input has been shutdown. channelInputClosed(ctx, false); } super.userEventTriggered(ctx, evt); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpResponse) { ctx.channel().attr(ATTR_HTTP_RESP).set((HttpResponse) msg); } try { super.channelRead(ctx, msg); } finally { if (msg instanceof LastHttpContent) { fireCompleteEventIfNotAlready(ctx, CompleteReason.SESSION_COMPLETE); } } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { try { if (cause instanceof Http2Exception) { incrementErrorCounter(registry, errorCounterName, metricId, (Http2Exception) cause); } } finally { super.exceptionCaught(ctx, cause); } } }