public void TriggerInactive()
        {
            var handlers = InboundHandlers.Cast <IChannelHandler>().Union(OutboundHandlers);

            foreach (var item in handlers.Where(item => item.IsActivated))
            {
                item.ChannelInactive(_ctx);
            }
            Logger.Debug("Channel {0} inactivated.", _channel);
        }
 public void TriggerException(Exception cause)
 {
     Logger.Error("Exception occurred in pipeline: {0}", cause.ToString());
     // first, notify all handlers
     foreach (var handler in InboundHandlers.Cast <IChannelHandler>().Union(OutboundHandlers))
     {
         handler.ExceptionCaught(_ctx, cause);
     }
     // then, throw exception
     throw cause;
 }