/** * 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); }
/** * Invoked when an exception was raised by an I/O thread or a * {@link ChannelHandler}. */ public void exceptionCaught( ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { ChannelPipeline pipeline = ctx.getPipeline(); ChannelHandler last = pipeline.getLast(); if (!(last instanceof ChannelUpstreamHandler) && ctx instanceof DefaultChannelPipeline) { // The names comes in the order of which they are insert when using DefaultChannelPipeline List<String> names = ctx.getPipeline().getNames(); for (int i = names.size() - 1; i >= 0; i--) { ChannelHandler handler = ctx.getPipeline().get(names.get(i)); if (handler instanceof ChannelUpstreamHandler) { // find the last handler last = handler; break; } } } if (this == last) { logger.warn( "EXCEPTION, please implement " + getClass().getName() + ".exceptionCaught() for proper handling.", e.getCause()); } ctx.sendUpstream(e); }
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (this == ctx.getPipeline().getLast()) { log.warn("EXCEPTION, please implement " + getClass().getName() + ".exceptionCaught() for proper handling.", e.getCause()); } } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10; OFMessage m = factory.buildEchoRequest().build(); log.debug("Sending Echo Request on idle channel: {}", e.getChannel().getPipeline().getLast().toString()); e.getChannel().write(Collections.singletonList(m)); // XXX S some problems here -- echo request has no transaction id, and // echo reply is not correlated to the echo request. }