Ejemplo n.º 1
0
 public ServiceDispatcher(Uri baseAddress, Binding binding, EndpointDispatcherTable endpointDispatcherTable)
 {
     BaseAddress = baseAddress;
     Binding     = binding;
     _endpointDispatcherTable = endpointDispatcherTable;
     // TODO: Maybe make lazy
     _requestReplyCorrelator = new RequestReplyCorrelator();
 }
Ejemplo n.º 2
0
 public SecurityServiceDispatcher(SecurityBindingElement transportSecurityBindingElement, BindingContext context, IServiceDispatcher serviceDispatcher)
 {
     this.InnerServiceDispatcher   = serviceDispatcher;
     this.bindingContext           = context;
     this.transportSecurityBinding = transportSecurityBindingElement;
     _requestReplyCorrelator       = new RequestReplyCorrelator();
     // this.securityProtocolFactory =  securityProtocolFactory; // we set it later from TransportSecurityBindingElement
     //  this.settingsLifetimeManager = new SecurityListenerSettingsLifetimeManager(this.securityProtocolFactory, this.sessionServerSettings, this.sessionMode, this.InnerChannelListener);
 }
Ejemplo n.º 3
0
        internal void Init(IDuplexChannel channel, IRequestReplyCorrelator correlator, Uri listenUri)
        {
            if (initialized)
            {
                Fx.Assert(this.channel == channel, "Wrong channel when calling Init");
                Fx.Assert(this.correlator == correlator, "Wrong channel when calling Init");
                Fx.Assert(this.listenUri == listenUri, "Wrong listenUri when calling Init");
                return;
            }

            Fx.Assert(channel != null, "caller must verify");
            Fx.Assert(correlator != null, "caller must verify");

            this.channel          = channel;
            this.listenUri        = listenUri;
            this.channel.Faulted += new EventHandler(OnFaulted);
            initialized           = true;
        }
        internal ImmutableDispatchRuntime(DispatchRuntime dispatch)
        {
            this.authenticationBehavior = AuthenticationBehavior.TryCreate(dispatch);
            this.authorizationBehavior = AuthorizationBehavior.TryCreate(dispatch);
            this.concurrency = new ConcurrencyBehavior(dispatch);
            this.error = new ErrorBehavior(dispatch.ChannelDispatcher);
            this.enableFaults = dispatch.EnableFaults;
            this.inputSessionShutdownHandlers = EmptyArray<IInputSessionShutdown>.ToArray(dispatch.InputSessionShutdownHandlers);
            this.instance = new InstanceBehavior(dispatch, this);
            this.isOnServer = dispatch.IsOnServer;
            this.manualAddressing = dispatch.ManualAddressing;
            this.messageInspectors = EmptyArray<IDispatchMessageInspector>.ToArray(dispatch.MessageInspectors);
            this.requestReplyCorrelator = new RequestReplyCorrelator();
            this.securityImpersonation = SecurityImpersonationBehavior.CreateIfNecessary(dispatch);
            this.requireClaimsPrincipalOnOperationContext = dispatch.RequireClaimsPrincipalOnOperationContext;
            this.impersonateOnSerializingReply = dispatch.ImpersonateOnSerializingReply;
            this.terminate = TerminatingOperationBehavior.CreateIfNecessary(dispatch);
            this.thread = new ThreadBehavior(dispatch);
            this.validateMustUnderstand = dispatch.ValidateMustUnderstand;
            this.ignoreTransactionFlow = dispatch.IgnoreTransactionMessageProperty;
            this.transaction = TransactionBehavior.CreateIfNeeded(dispatch);
            this.receiveContextEnabledChannel = dispatch.ChannelDispatcher.ReceiveContextEnabled;
            this.sendAsynchronously = dispatch.ChannelDispatcher.SendAsynchronously;
            this.parameterInspectorCorrelationOffset = (dispatch.MessageInspectors.Count +
                dispatch.MaxCallContextInitializers);
            this.correlationCount = this.parameterInspectorCorrelationOffset + dispatch.MaxParameterInspectors;

            DispatchOperationRuntime unhandled = new DispatchOperationRuntime(dispatch.UnhandledDispatchOperation, this);

            if (dispatch.OperationSelector == null)
            {
                ActionDemuxer demuxer = new ActionDemuxer();
                for (int i = 0; i < dispatch.Operations.Count; i++)
                {
                    DispatchOperation operation = dispatch.Operations[i];
                    DispatchOperationRuntime operationRuntime = new DispatchOperationRuntime(operation, this);
                    demuxer.Add(operation.Action, operationRuntime);
                }

                demuxer.SetUnhandled(unhandled);
                this.demuxer = demuxer;
            }
            else
            {
                CustomDemuxer demuxer = new CustomDemuxer(dispatch.OperationSelector);
                for (int i = 0; i < dispatch.Operations.Count; i++)
                {
                    DispatchOperation operation = dispatch.Operations[i];
                    DispatchOperationRuntime operationRuntime = new DispatchOperationRuntime(operation, this);
                    demuxer.Add(operation.Name, operationRuntime);
                }

                demuxer.SetUnhandled(unhandled);
                this.demuxer = demuxer;
            }

            this.processMessage1 = new MessageRpcProcessor(this.ProcessMessage1);
            this.processMessage11 = new MessageRpcProcessor(this.ProcessMessage11);
            this.processMessage2 = new MessageRpcProcessor(this.ProcessMessage2);
            this.processMessage3 = new MessageRpcProcessor(this.ProcessMessage3);
            this.processMessage31 = new MessageRpcProcessor(this.ProcessMessage31);
            this.processMessage4 = new MessageRpcProcessor(this.ProcessMessage4);
            this.processMessage41 = new MessageRpcProcessor(this.ProcessMessage41);
            this.processMessage5 = new MessageRpcProcessor(this.ProcessMessage5);
            this.processMessage6 = new MessageRpcProcessor(this.ProcessMessage6);
            this.processMessage7 = new MessageRpcProcessor(this.ProcessMessage7);
            this.processMessage8 = new MessageRpcProcessor(this.ProcessMessage8);
            this.processMessage9 = new MessageRpcProcessor(this.ProcessMessage9);
            this.processMessageCleanup = new MessageRpcProcessor(this.ProcessMessageCleanup);
            this.processMessageCleanupError = new MessageRpcProcessor(this.ProcessMessageCleanupError);
        }
Ejemplo n.º 5
0
 internal void Init(IDuplexSessionChannel channel, IRequestReplyCorrelator correlator, Uri listenUri)
 {
     Init((IDuplexChannel)channel, correlator, listenUri);
     HasSession = true;
 }
Ejemplo n.º 6
0
 public ServiceDispatcher(ChannelDispatcher channelDispatcher)
 {
     ChannelDispatcher = channelDispatcher;
     // TODO: Maybe make lazy
     _requestReplyCorrelator = new RequestReplyCorrelator();
 }
Ejemplo n.º 7
0
 internal DuplexSessionListenerBinder(IChannelListener<IDuplexSessionChannel> listener, MessageVersion messageVersion)
 {
     this.correlator = new RequestReplyCorrelator();
     this.listener = listener;
     this.messageVersion = messageVersion;
 }
Ejemplo n.º 8
0
 internal DuplexListenerBinder(IChannelListener <IDuplexChannel> listener, MessageVersion messageVersion)
 {
     _correlator     = new RequestReplyCorrelator();
     _listener       = listener;
     _messageVersion = messageVersion;
 }
Ejemplo n.º 9
0
 internal DuplexListenerBinder(IChannelListener<IDuplexChannel> listener, MessageVersion messageVersion)
 {
     _correlator = new RequestReplyCorrelator();
     _listener = listener;
     _messageVersion = messageVersion;
 }
Ejemplo n.º 10
0
 internal DuplexSessionListenerBinder(IChannelListener <IDuplexSessionChannel> listener, MessageVersion messageVersion)
 {
     correlator          = new RequestReplyCorrelator();
     this.listener       = listener;
     this.messageVersion = messageVersion;
 }
 internal DuplexChannelBinder(IDuplexSessionChannel channel, IRequestReplyCorrelator correlator, Uri listenUri) : this((IDuplexChannel)channel, correlator, listenUri)
 {
     this.isSession = true;
 }
 internal DuplexChannelBinder(IDuplexSessionChannel channel, IRequestReplyCorrelator correlator, bool useActiveAutoClose) : this(useActiveAutoClose ? ((IDuplexSessionChannel) new AutoCloseDuplexSessionChannel(channel)) : channel, correlator, (Uri)null)
 {
 }
 internal DuplexChannelBinder(IDuplexChannel channel, IRequestReplyCorrelator correlator, Uri listenUri) : this(channel, correlator)
 {
     this.listenUri = listenUri;
 }
 internal DuplexChannelBinder(IDuplexChannel channel, IRequestReplyCorrelator correlator)
 {
     this.channel          = channel;
     this.correlator       = correlator;
     this.channel.Faulted += new EventHandler(this.OnFaulted);
 }