Esempio n. 1
0
        internal AmqpChannelFactory(AmqpTransportBindingElement bindingElement, BindingContext context)
            : base(context.Binding)
        {
            this.bindingElement    = bindingElement;
            this.bindingContext    = context;
            this.channelProperties = bindingElement.ChannelProperties.Clone();
            this.shared            = bindingElement.Shared;
            this.prefetchLimit     = bindingElement.PrefetchLimit;
            this.maxBufferPoolSize = bindingElement.MaxBufferPoolSize;
            Collection <MessageEncodingBindingElement> messageEncoderBindingElements
                = context.BindingParameters.FindAll <MessageEncodingBindingElement>();

            if (messageEncoderBindingElements.Count > 1)
            {
                throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext");
            }
            else if (messageEncoderBindingElements.Count == 1)
            {
                this.messageEncoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory();
            }
            else
            {
                this.messageEncoderFactory = new TextMessageEncodingBindingElement().CreateMessageEncoderFactory();
            }

            openChannels = new List <AmqpTransportChannel>();
        }
Esempio n. 2
0
        internal AmqpChannelListener(AmqpTransportBindingElement bindingElement, BindingContext context)
            : base(context.Binding)
        {
            this.bindingElement    = bindingElement;
            this.channelProperties = bindingElement.ChannelProperties.Clone();
            this.bindingContext    = context;
            this.shared            = bindingElement.Shared;
            this.prefetchLimit     = bindingElement.PrefetchLimit;

            this.maxBufferPoolSize = bindingElement.MaxBufferPoolSize;

            // TODO: review this.  Should be unique hostname based
            this.uri = context.ListenUriBaseAddress;
            this.asyncOnAcceptCaller = new AsyncOnAcceptCaller(this.OnAcceptChannel);
            this.acceptWaitEvent     = new ManualResetEvent(false);

            Collection <MessageEncodingBindingElement> messageEncoderBindingElements
                = context.BindingParameters.FindAll <MessageEncodingBindingElement>();

            if (messageEncoderBindingElements.Count > 1)
            {
                throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext");
            }
            else if (messageEncoderBindingElements.Count == 1)
            {
                this.messageEncoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory();
            }
            else
            {
                this.messageEncoderFactory = new TextMessageEncodingBindingElement().CreateMessageEncoderFactory();
            }
        }
Esempio n. 3
0
 protected AmqpTransportBindingElement(AmqpTransportBindingElement other)
     : base(other)
 {
     this.channelProperties = other.channelProperties.Clone();
     this.shared            = other.shared;
     this.prefetchLimit     = other.prefetchLimit;
     this.bindingSecurity   = other.bindingSecurity;
 }
Esempio n. 4
0
 protected AmqpBinding(MessageEncodingBindingElement encoding)
 {
     this.encoding = encoding;
     transport     = new AmqpTransportBindingElement();
 }