X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fcommons%2Fprotocol-framework%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fframework%2FAbstractProtocolSession.java;h=44afc4e7a1f18c52b61916a8e3948343122956c1;hb=614324d63a339ef4acbc9e2c3bbaaef469f97868;hp=e7bd66574036111c72a0ddad5291afdd905e1ac7;hpb=b369c0185a99952c3609aad40ebeba3e4be8c5b2;p=controller.git diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java index e7bd665740..44afc4e7a1 100644 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java +++ b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractProtocolSession.java @@ -13,6 +13,7 @@ import io.netty.channel.SimpleChannelInboundHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Deprecated public abstract class AbstractProtocolSession extends SimpleChannelInboundHandler implements ProtocolSession { private static final Logger LOG = LoggerFactory.getLogger(AbstractProtocolSession.class); @@ -37,9 +38,16 @@ public abstract class AbstractProtocolSession extends SimpleChannelInboundHan public final void channelInactive(final ChannelHandlerContext ctx) { LOG.debug("Channel {} inactive.", ctx.channel()); endOfInput(); + try { + // Forward channel inactive event, all handlers in pipeline might be interested in the event e.g. close channel handler of reconnect promise + super.channelInactive(ctx); + } catch (final Exception e) { + throw new RuntimeException("Failed to delegate channel inactive event on channel " + ctx.channel(), e); + } } @Override + @SuppressWarnings("unchecked") protected final void channelRead0(final ChannelHandlerContext ctx, final Object msg) { LOG.debug("Message was received: {}", msg); handleMessage((M) msg);