示例#1
0
 public override void AddInterceptor(int index, IChannelInterceptor interceptor)
 {
     base.AddInterceptor(index, interceptor);
     if (interceptor is ITaskSchedulerChannelInterceptor)
     {
         TaskSchedulerInterceptorsSize++;
     }
 }
 public virtual void AddInterceptor(IChannelInterceptor interceptor)
 {
     lock (_lock)
     {
         var interceptors = new List <IChannelInterceptor>(_interceptors);
         interceptors.Add(interceptor);
         _interceptors = interceptors;
     }
 }
 public virtual void AddInterceptor(int index, IChannelInterceptor interceptor)
 {
     lock (_lock)
     {
         var interceptors = new List <IChannelInterceptor>(_interceptors);
         interceptors.Insert(index, interceptor);
         _interceptors = interceptors;
     }
 }
 public virtual bool RemoveInterceptor(IChannelInterceptor interceptor)
 {
     lock (_lock)
     {
         var interceptors = new List <IChannelInterceptor>(_interceptors);
         var result       = interceptors.Remove(interceptor);
         _interceptors = interceptors;
         return(result);
     }
 }
示例#5
0
 public void Add(int index, IChannelInterceptor interceptor)
 {
     lock (_lock)
     {
         var interceptors = new List <IChannelInterceptor>(_interceptors);
         interceptors.Insert(index, interceptor);
         _interceptors = interceptors.ToArray();
         Count         = _interceptors.Length;
     }
 }
示例#6
0
        public override bool RemoveInterceptor(IChannelInterceptor interceptor)
        {
            var removed = base.RemoveInterceptor(interceptor);

            if (removed && interceptor is ITaskSchedulerChannelInterceptor)
            {
                TaskSchedulerInterceptorsSize--;
            }

            return(removed);
        }
示例#7
0
 public bool Remove(IChannelInterceptor interceptor)
 {
     lock (_lock)
     {
         var interceptors = new List <IChannelInterceptor>(_interceptors);
         var result       = interceptors.Remove(interceptor);
         _interceptors = interceptors.ToArray();
         Count         = _interceptors.Length;
         return(result);
     }
 }
示例#8
0
 public bool Add(IChannelInterceptor interceptor)
 {
     lock (_lock)
     {
         var interceptors = new List <IChannelInterceptor>(_interceptors);
         interceptors.Add(interceptor);
         _interceptors = interceptors.ToArray();
         Count         = _interceptors.Length;
         return(true);
     }
 }
示例#9
0
 private void UpdateInterceptorsFor(IChannelInterceptor interceptor)
 {
     if (interceptor is ITaskSchedulerChannelInterceptor)
     {
         lock (_lock)
         {
             var schedulerInterceptors = new List <ITaskSchedulerChannelInterceptor>(_schedulerInterceptors);
             schedulerInterceptors.Add((ITaskSchedulerChannelInterceptor)interceptor);
             _schedulerInterceptors = schedulerInterceptors;
         }
     }
 }
示例#10
0
 public virtual bool RemoveInterceptor(IChannelInterceptor interceptor)
 {
     return(Interceptors.Remove(interceptor));
 }
 public int Add(IChannelInterceptor interceptor)
 {
     return(_interceptors.Add(interceptor));
 }
示例#12
0
 /// <summary>
 /// The constructor that takes three parameters; the channel manager, the inner channel and
 /// the interceptor. The channel manager and the inner channel is given to the base
 /// constructor of the ChannelBase. The interceptor is used intercept the replies.
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="innerChannel"></param>
 /// <param name="channelInterceptor"></param>
 public InterceptorReplyChannel(ChannelManagerBase manager, IReplyChannel innerChannel, IChannelInterceptor channelInterceptor)
     : base(manager, innerChannel)
 {
     this._channelInterceptor = channelInterceptor;
     this.logger = LoggerFactory.Create(this.GetType());
 }
示例#13
0
 public InterceptorRequestSessionChannel(ChannelManagerBase manager, IRequestSessionChannel innerChannel, IChannelInterceptor channelInterceptor)
     : base(manager, innerChannel, channelInterceptor)
 {
     _innerChannel = innerChannel;
 }
 public int Add(IChannelInterceptor interceptor)
 {
     return _interceptors.Add(interceptor);
 }
示例#15
0
 public void AddInterceptor(int index, IChannelInterceptor interceptor)
 {
     _interceptors.Insert(index, interceptor);
 }
示例#16
0
 public void AddInterceptor(IChannelInterceptor interceptor)
 {
     _interceptors.Add(interceptor);
 }
示例#17
0
 public override void AddInterceptor(int index, IChannelInterceptor interceptor)
 {
     base.AddInterceptor(index, interceptor);
     UpdateInterceptorsFor(interceptor);
 }
 /// <summary>
 /// Add a channel interceptor to the end of the list.
 /// </summary>
 public void AddInterceptor(IChannelInterceptor interceptor)
 {
     _interceptors.Add(interceptor);
 }
示例#19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context">binding context</param>
 /// <param name="channelInterceptor">channel interceptor</param>
 public ChannelListenerChannelListener(BindingContext context, IChannelInterceptor channelInterceptor)
 {
     this.context = context;
     this.innerChannelListener = context.BuildInnerChannelListener <TChannel>();
     this.channelInterceptor   = channelInterceptor;
 }
示例#20
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context">binding context</param>
 /// <param name="channelInterceptor">channel interceptor</param>
 public InterceptorChannelFactory(BindingContext context, IChannelInterceptor channelInterceptor)
 {
     _innerChannelFactory = context.BuildInnerChannelFactory <TChannel>();
     _channelInterceptor  = channelInterceptor;
 }
示例#21
0
 public virtual void AddInterceptor(int index, IChannelInterceptor interceptor)
 {
     Interceptors.Add(index, interceptor);
 }
示例#22
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="innerContext">inner context</param>
 /// <param name="message">The incoming System.ServiceModel.Channels.Message that contains the request</param>
 /// <param name="channelInterceptor">channel interceptor</param>
 public InterceptorRequestContext(RequestContext innerContext, Message message, IChannelInterceptor channelInterceptor)
 {
     _innerContext       = innerContext;
     _message            = message;
     _channelInterceptor = channelInterceptor;
 }