public static void replaceDefaultHandler( @NotNull ChannelHandlerContext context, @NotNull SimpleChannelUpstreamHandler messageChannelHandler) { context .getPipeline() .replace( DelegatingHttpRequestHandler.class, "replacedDefaultHandler", messageChannelHandler); }
/** Invoked when an exception was raised by an I/O thread or a {@link ChannelHandler}. */ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (this == ctx.getPipeline().getLast()) { logger.warn( "EXCEPTION, please implement " + getClass().getName() + ".exceptionCaught() for proper handling.", e.getCause()); } ctx.sendUpstream(e); }