/// <summary> /// Set down stream end point /// </summary> /// <param name="handler"> </param> public void SetChannel(IDownstreamHandler handler) { if (handler == null) throw new ArgumentNullException("handler"); _downStreamEndPoint = handler; _channelContext = new PipelineDownstreamContext(this, _downStreamEndPoint); _downstreamContexts.Last.Value.NextHandler = _channelContext; }
/// <summary> /// Set down stream end point /// </summary> /// <param name="channel">channel which will handle all down stream messages</param> public void SetChannel(IChannel channel) { if (channel == null) throw new ArgumentNullException("channel"); _channel = channel; _channelContext = new PipelineDownstreamContext(this, new ChannelAsDownstreeamHandler(_channel)); _downstreamContexts.Last.Value.NextHandler = _channelContext; }
/// <summary> /// Set down stream end point /// </summary> /// <param name="handler"> </param> public void SetChannel(IDownstreamHandler handler) { if (handler == null) { throw new ArgumentNullException("handler"); } _downStreamEndPoint = handler; _channelContext = new PipelineDownstreamContext(this, _downStreamEndPoint); _downstreamContexts.Last.Value.NextHandler = _channelContext; }
/// <summary> /// Set down stream end point /// </summary> /// <param name="channel">channel which will handle all down stream messages</param> public void SetChannel(IChannel channel) { if (channel == null) { throw new ArgumentNullException("channel"); } _channel = channel; _channelContext = new PipelineDownstreamContext(this, new ChannelAsDownstreeamHandler(_channel)); _downstreamContexts.Last.Value.NextHandler = _channelContext; }
/// <summary> /// Add a new downstream handler /// </summary> /// <param name="handler">Handler to add</param> /// <remarks>Downstream handlers takes care of everything sent from the client to the channel.</remarks> public void AddDownstreamHandler(IDownstreamHandler handler) { // always link with channel handler (will be replaced when the pipe is filled with more handlers // so that only the last handler has the channel as NextHandler). var ctx = new PipelineDownstreamContext(this, handler) {NextHandler = _channelContext}; var last = _downstreamContexts.Last; if (last != null) { _logger.Debug("Added downstream handler " + handler + " and linked it as next handler for " + last.Value); last.Value.NextHandler = ctx; } else { _logger.Debug("Added downstream handler " + handler); } _downstreamContexts.AddLast(ctx); }
/// <summary> /// Add a new downstream handler /// </summary> /// <param name="handler">Handler to add</param> /// <remarks>Downstream handlers takes care of everything sent from the client to the channel.</remarks> public void AddDownstreamHandler(IDownstreamHandler handler) { // always link with channel handler (will be replaced when the pipe is filled with more handlers // so that only the last handler has the channel as NextHandler). var ctx = new PipelineDownstreamContext(this, handler) { NextHandler = _channelContext }; var last = _downstreamContexts.Last; if (last != null) { _logger.Debug("Added downstream handler " + handler + " and linked it as next handler for " + last.Value); last.Value.NextHandler = ctx; } else { _logger.Debug("Added downstream handler " + handler); } _downstreamContexts.AddLast(ctx); }