package org.opendaylight.protocol.framework;
import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
*/
protected final void sendMessage(final M msg) {
this.channel.writeAndFlush(msg).addListener(
- new ChannelFutureListener() {
- @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);
- }
+ (ChannelFutureListener) f -> {
+ if (!f.isSuccess()) {
+ LOG.info("Failed to send message {}", msg, f.cause());
+ negotiationFailed(f.cause());
+ } else {
+ LOG.trace("Message {} sent to socket", msg);
}
});
}
LOG.debug("Starting session negotiation on channel {}", channel);
try {
startNegotiation();
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.warn("Unexpected negotiation failure", e);
negotiationFailed(e);
}
LOG.debug("Negotiation read invoked on channel {}", channel);
try {
handleMessage((M)msg);
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.debug("Unexpected error while handling negotiation message {}", msg, e);
negotiationFailed(e);
}