Esempio n. 1
0
        protected ServiceBusChannelListener(BindingContext context, NetMessagingTransportBindingElement transport) : base(context.Binding)
        {
            this.listenUri = context.ListenUriBaseAddress;
            if (!string.IsNullOrEmpty(context.ListenUriRelativeAddress))
            {
                this.listenUri = new System.Uri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
            }
            this.MaxBufferSize         = (int)Math.Min(transport.MaxReceivedMessageSize, (long)2147483647);
            this.ReceiveContextEnabled = transport.ReceiveContextEnabled;
            MessageEncodingBindingElement messageEncodingBindingElement = context.BindingParameters.Find <MessageEncodingBindingElement>();

            if (messageEncodingBindingElement == null)
            {
                messageEncodingBindingElement = Microsoft.ServiceBus.Messaging.Channels.TransportDefaults.CreateDefaultEncoder();
            }
            this.MessageEncoderFactory    = messageEncodingBindingElement.CreateMessageEncoderFactory();
            this.MessagingFactorySettings = transport.CreateMessagingFactorySettings(context);
            this.MessagingAddress         = new Microsoft.ServiceBus.Messaging.MessagingAddress(this.Uri, this.MessagingFactorySettings.NetMessagingTransportSettings.GatewayMode);
            if (this.MessagingAddress.Type != MessagingAddressType.Entity)
            {
                throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.Argument("ListenUriBaseAddress", SRClient.EntityNameNotFound(this.MessagingAddress.ToString()));
            }
            this.TransportBindingElement = transport;
            this.PrefetchCount           = transport.PrefetchCount;
        }
        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);
            NetMessagingTransportBindingElement prefetchCount = (NetMessagingTransportBindingElement)bindingElement;

            prefetchCount.PrefetchCount      = this.PrefetchCount;
            prefetchCount.SessionIdleTimeout = this.SessionIdleTimeout;
            this.TransportSettings.ApplyTo(prefetchCount.TransportSettings);
        }
        protected override void InitializeFrom(BindingElement bindingElement)
        {
            base.InitializeFrom(bindingElement);
            NetMessagingTransportBindingElement netMessagingTransportBindingElement = (NetMessagingTransportBindingElement)bindingElement;

            this.PrefetchCount      = netMessagingTransportBindingElement.PrefetchCount;
            this.SessionIdleTimeout = netMessagingTransportBindingElement.SessionIdleTimeout;
            this.TransportSettings.InitializeFrom(netMessagingTransportBindingElement.TransportSettings);
        }
 void System.ServiceModel.Description.IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
 {
     if (importer == null || context == null)
     {
         throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.ArgumentNull((importer == null ? "importer" : "context"));
     }
     if (context.GetBindingAssertions().Remove("netMessaging", "http://sample.schemas.microsoft.com/policy/netMessaging") != null)
     {
         NetMessagingTransportBindingElement netMessagingTransportBindingElement = new NetMessagingTransportBindingElement();
         context.BindingElements.Add(netMessagingTransportBindingElement);
     }
 }
Esempio n. 5
0
        public ServiceBusChannelFactory(BindingContext context, NetMessagingTransportBindingElement transport) : base(context.Binding)
        {
            this.MessagingFactorySettings = transport.CreateMessagingFactorySettings(context);
            this.ManualAddressing         = transport.ManualAddressing;
            this.MaxBufferPoolSize        = transport.MaxBufferPoolSize;
            this.MaxBufferSize            = (int)Math.Min(transport.MaxReceivedMessageSize, (long)2147483647);
            MessageEncodingBindingElement messageEncodingBindingElement = context.BindingParameters.Find <MessageEncodingBindingElement>();

            if (messageEncodingBindingElement == null)
            {
                messageEncodingBindingElement = Microsoft.ServiceBus.Messaging.Channels.TransportDefaults.CreateDefaultEncoder();
            }
            this.MessageEncoderFactory = messageEncodingBindingElement.CreateMessageEncoderFactory();
        }
        public void ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
        {
            NetMessagingBinding name;

            if (context == null || context.Endpoint.Binding == null)
            {
                throw Microsoft.ServiceBus.Messaging.FxTrace.Exception.ArgumentNull((context == null ? "context" : "context.Endpoint.Binding"));
            }
            BindingElementCollection            bindingElementCollection            = context.Endpoint.Binding.CreateBindingElements();
            NetMessagingTransportBindingElement netMessagingTransportBindingElement = bindingElementCollection.Find <TransportBindingElement>() as NetMessagingTransportBindingElement;

            if (netMessagingTransportBindingElement != null)
            {
                NetMessagingBindingElementImporter.ImportAddress(context);
            }
            if (context.Endpoint.Binding is CustomBinding && netMessagingTransportBindingElement != null && NetMessagingBinding.TryCreate(bindingElementCollection, out name))
            {
                name.Name                = context.Endpoint.Binding.Name;
                name.Namespace           = context.Endpoint.Binding.Namespace;
                context.Endpoint.Binding = name;
            }
        }
 public BrokeredBinding()
 {
     this.encodingElement = new BrokeredEncodingBindingElement();
     this.transportElement = new NetMessagingTransportBindingElement();
 }
Esempio n. 8
0
 public BrokeredBinding()
 {
     this.encodingElement  = new BrokeredEncodingBindingElement();
     this.transportElement = new NetMessagingTransportBindingElement();
 }
 public ServiceBusInputChannelListener(BindingContext context, NetMessagingTransportBindingElement transport) : base(context, transport)
 {
     this.singletonAcceptor = new InputQueue <IInputChannel>();
 }
Esempio n. 10
0
 public ServiceBusInputSessionChannelListener(BindingContext context, NetMessagingTransportBindingElement transport) : base(context, transport)
 {
     this.retryTimeSpan = ServiceBusInputSessionChannelListener.InitialRetrySleepTime;
 }