X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fcommons%2Fprotocol-framework%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fframework%2FAbstractProtocolSession.java;h=44afc4e7a1f18c52b61916a8e3948343122956c1;hp=e7bd66574036111c72a0ddad5291afdd905e1ac7;hb=74a7fe23a2fb58d7971b43f5b16a1481dc74966d;hpb=391180fcde6a7a2336182e346e24a1ff9f754062 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);