コード例 #1
0
 public static void replaceDefaultHandler(
     @NotNull ChannelHandlerContext context,
     @NotNull SimpleChannelUpstreamHandler messageChannelHandler) {
   context
       .getPipeline()
       .replace(
           DelegatingHttpRequestHandler.class, "replacedDefaultHandler", messageChannelHandler);
 }
コード例 #2
0
 /** 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);
 }