@Override @SuppressWarnings("unchecked") public final void channelRead(final ChannelHandlerContext ctx, final Object msg) { LOG.debug("Negotiation read invoked on channel {}", channel); try { handleMessage((M)msg); } catch (Exception e) { LOG.debug("Unexpected error while handling negotiation message {}", msg, e); negotiationFailed(e); } }
@Override public final void channelActive(final ChannelHandlerContext ctx) { LOG.debug("Starting session negotiation on channel {}", channel); try { startNegotiation(); } catch (Exception e) { LOG.warn("Unexpected negotiation failure", e); negotiationFailed(e); } }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { LOG.info("Unexpected error during negotiation", cause); negotiationFailed(cause); } }
@Override public void operationComplete(final ChannelFuture f) { if (!f.isSuccess()) { LOG.info("Failed to send message {}", msg, f.cause()); negotiationFailed(f.cause()); } else { LOG.trace("Message {} sent to socket", msg); } } });