@Test(expected = Exception.class) public void testExceptionCaught() throws Exception { isisChannelHandler.exceptionCaught(channelHandlerContext, exceptionEvent); assertThat(isisChannelHandler, is(notNullValue())); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (e.getCause() instanceof ReadTimeoutException) { log.debug("Disconnecting device {} due to read timeout", e.getChannel().getRemoteAddress()); return; } else if (e.getCause() instanceof ClosedChannelException) { log.debug("Channel for ISIS {} already closed", e.getChannel().getRemoteAddress()); } else if (e.getCause() instanceof IOException) { log.debug("Disconnecting ISIS {} due to IO Error: {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } else if (e.getCause() instanceof IsisParseException) { IsisParseException errMsg = (IsisParseException) e.getCause(); byte errorCode = errMsg.errorCode(); byte errorSubCode = errMsg.errorSubCode(); log.debug("Error while parsing message from ISIS {}, ErrorCode {}", e.getChannel().getRemoteAddress(), errorCode); } else if (e.getCause() instanceof RejectedExecutionException) { log.debug("Could not process message: queue full"); } else { log.debug("Error while processing message from ISIS {}, {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } }
IsisChannelHandler extends IdleStateAwareChannelHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (e.getCause() instanceof ReadTimeoutException) { log.debug("Disconnecting device {} due to read timeout", e.getChannel().getRemoteAddress()); return; } else if (e.getCause() instanceof ClosedChannelException) { log.debug("Channel for ISIS {} already closed", e.getChannel().getRemoteAddress()); } else if (e.getCause() instanceof IOException) { log.debug("Disconnecting ISIS {} due to IO Error: {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } else if (e.getCause() instanceof IsisParseException) { IsisParseException errMsg = (IsisParseException) e.getCause(); byte errorCode = errMsg.errorCode(); byte errorSubCode = errMsg.errorSubCode(); log.debug("Error while parsing message from ISIS {}, ErrorCode {}", e.getChannel().getRemoteAddress(), errorCode); } else if (e.getCause() instanceof RejectedExecutionException) { log.debug("Could not process message: queue full"); } else { log.debug("Error while processing message from ISIS {}, {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } } }
IsisChannelHandler extends IdleStateAwareChannelHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (e.getCause() instanceof ReadTimeoutException) { log.debug("Disconnecting device {} due to read timeout", e.getChannel().getRemoteAddress()); return; } else if (e.getCause() instanceof ClosedChannelException) { log.debug("Channel for ISIS {} already closed", e.getChannel().getRemoteAddress()); } else if (e.getCause() instanceof IOException) { log.debug("Disconnecting ISIS {} due to IO Error: {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } else if (e.getCause() instanceof IsisParseException) { IsisParseException errMsg = (IsisParseException) e.getCause(); byte errorCode = errMsg.errorCode(); byte errorSubCode = errMsg.errorSubCode(); log.debug("Error while parsing message from ISIS {}, ErrorCode {}", e.getChannel().getRemoteAddress(), errorCode); } else if (e.getCause() instanceof RejectedExecutionException) { log.debug("Could not process message: queue full"); } else { log.debug("Error while processing message from ISIS {}, {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } } IsisChannelHandler(Controller controller, List<IsisProcess> processes); }
IsisChannelHandler extends IdleStateAwareChannelHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (e.getCause() instanceof ReadTimeoutException) { log.debug("Disconnecting device {} due to read timeout", e.getChannel().getRemoteAddress()); return; } else if (e.getCause() instanceof ClosedChannelException) { log.debug("Channel for ISIS {} already closed", e.getChannel().getRemoteAddress()); } else if (e.getCause() instanceof IOException) { log.debug("Disconnecting ISIS {} due to IO Error: {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } else if (e.getCause() instanceof IsisParseException) { IsisParseException errMsg = (IsisParseException) e.getCause(); byte errorCode = errMsg.errorCode(); byte errorSubCode = errMsg.errorSubCode(); log.debug("Error while parsing message from ISIS {}, ErrorCode {}", e.getChannel().getRemoteAddress(), errorCode); } else if (e.getCause() instanceof RejectedExecutionException) { log.debug("Could not process message: queue full"); } else { log.debug("Error while processing message from ISIS {}, {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } } IsisChannelHandler(Controller controller, List<IsisProcess> processes); void initializeInterfaceMap(); void updateInterfaceMap(List<IsisProcess> isisProcesses); void initializeInterfaceIpList(); @Override void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e); @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e); void processIsisMessage(IsisMessage isisMessage, ChannelHandlerContext ctx); void startHelloSender(); void stopHelloSender(); void sentConfigPacket(byte[] configPacket); }
IsisChannelHandler extends IdleStateAwareChannelHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (e.getCause() instanceof ReadTimeoutException) { log.debug("Disconnecting device {} due to read timeout", e.getChannel().getRemoteAddress()); return; } else if (e.getCause() instanceof ClosedChannelException) { log.debug("Channel for ISIS {} already closed", e.getChannel().getRemoteAddress()); } else if (e.getCause() instanceof IOException) { log.debug("Disconnecting ISIS {} due to IO Error: {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } else if (e.getCause() instanceof IsisParseException) { IsisParseException errMsg = (IsisParseException) e.getCause(); byte errorCode = errMsg.errorCode(); byte errorSubCode = errMsg.errorSubCode(); log.debug("Error while parsing message from ISIS {}, ErrorCode {}", e.getChannel().getRemoteAddress(), errorCode); } else if (e.getCause() instanceof RejectedExecutionException) { log.debug("Could not process message: queue full"); } else { log.debug("Error while processing message from ISIS {}, {}", e.getChannel().getRemoteAddress(), e.getCause().getMessage()); } } IsisChannelHandler(Controller controller, List<IsisProcess> processes); void initializeInterfaceMap(); void updateInterfaceMap(List<IsisProcess> isisProcesses); void initializeInterfaceIpList(); @Override void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e); @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e); void processIsisMessage(IsisMessage isisMessage, ChannelHandlerContext ctx); void startHelloSender(); void stopHelloSender(); void sentConfigPacket(byte[] configPacket);  }