Exemple #1
0
 public override IChannelListener <T> BuildChannelListener <T> (BindingContext ctx)
 {
     return(ctx.BuildInnerChannelListener <T> ());
 }
Exemple #2
0
 public override IChannelListener <TChannel> BuildChannelListener <TChannel>(BindingContext context)
 {
     context.BindingParameters.Add(this);
     return(context.BuildInnerChannelListener <TChannel>());
 }
 public InterceptorChannelListener(InterceptorBindingElement element, BindingContext context)
 {
     this.element = element;
     inner        = context.BuildInnerChannelListener <TChannel> ();
 }
Exemple #4
0
 public MyChannelListener(BindingContext context)
 {
     this.InnerChannelListener = context.BuildInnerChannelListener <TChannel>();
 }
 public RequestInterceptorReplySessionChannelListener(BindingContext c, Collection <RequestInterceptor> interceptors)
     : base(c.BuildInnerChannelListener <IReplySessionChannel>(), new Collection <RequestInterceptor>(interceptors))
 {
 }
        public override IChannelListener <TChannel> BuildChannelListener <TChannel>(BindingContext context)
        {
            if (!this.CanBuildChannelListener <TChannel>(context))
            {
                throw new InvalidOperationException("Unsupported channel type");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            ICollection <string>    operationParams         = this.GetOperationParams(context);
            ChunkingChannelListener chunkingChannelListener = new ChunkingChannelListener(context.BuildInnerChannelListener <IDuplexSessionChannel>(), operationParams, this.maxBufferedChunks);

            return((IChannelListener <TChannel>)chunkingChannelListener);
        }
 public SupportingTokenChannelListener(SupportingTokenBindingElement bindingElement, BindingContext context, SupportingTokenSecurityTokenResolver tokenResolver) : base(context.Binding, context.BuildInnerChannelListener <TChannel>())
 {
     this.protocolVersion = bindingElement.ProtocolVersion;
     this.tokenResolver   = tokenResolver;
 }
Exemple #8
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;
 }
Exemple #9
0
        public override IChannelListener <TChannel> BuildChannelListener <TChannel>(BindingContext context)
            where TChannel : class, IChannel
        {
            if (typeof(TChannel) != typeof(IReplyChannel))
            {
                ExceptionUtility exceptionUtility        = Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility;
                string           channelTypeNotSupported = Resources.ChannelTypeNotSupported;
                object[]         objArray = new object[] { typeof(TChannel) };
                throw exceptionUtility.ThrowHelperArgument("TChannel", Microsoft.ServiceBus.SR.GetString(channelTypeNotSupported, objArray));
            }
            NameSettings nameSetting = context.BindingParameters.Find <NameSettings>();

            if (nameSetting == null)
            {
                nameSetting = new NameSettings();
                context.BindingParameters.Add(nameSetting);
            }
            nameSetting.ServiceSettings.ListenerType                  = ListenerType.RelayedHttp;
            nameSetting.ServiceSettings.TransportProtection           = (this is HttpsRelayTransportBindingElement ? RelayTransportProtectionMode.EndToEnd : RelayTransportProtectionMode.None);
            nameSetting.ServiceSettings.RelayClientAuthenticationType = this.relayClientAuthenticationType;
            nameSetting.ServiceSettings.IsDynamic = this.IsDynamic;
            MessageEncodingBindingElement messageEncodingBindingElement = context.BindingParameters.Find <MessageEncodingBindingElement>();
            BindingContext bindingContext = this.CreateInnerListenerBindingContext(context);

            if (messageEncodingBindingElement != null)
            {
                context.BindingParameters.Remove <MessageEncodingBindingElement>();
            }
            return((IChannelListener <TChannel>)(new RelayHttpTransportChannelListener(context, messageEncodingBindingElement, bindingContext.BuildInnerChannelListener <IReplyChannel>())));
        }