Beispiel #1
0
 internal DispatchRuntime(ClientRuntime proxyRuntime, SharedRuntimeState shared)
     : this(shared)
 {
     ClientRuntime            = proxyRuntime ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(proxyRuntime));
     _instanceProvider        = new CallbackInstanceProvider();
     _channelDispatcher       = new ChannelDispatcher(shared);
     _instanceContextProvider = InstanceContextProviderBase.GetProviderForMode(InstanceContextMode.PerSession, this);
     Fx.Assert(!shared.IsOnServer, "Client constructor called on server?");
 }
 internal ClientRuntime(System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime, SharedRuntimeState shared) : this(dispatchRuntime.EndpointDispatcher.ContractName, dispatchRuntime.EndpointDispatcher.ContractNamespace, shared)
 {
     if (dispatchRuntime == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dispatchRuntime");
     }
     this.dispatchRuntime = dispatchRuntime;
     this.shared          = shared;
 }
Beispiel #3
0
        internal ClientRuntime(DispatchRuntime dispatchRuntime, SharedRuntimeState shared)
            : this(dispatchRuntime.EndpointDispatcher.ContractName,
                   dispatchRuntime.EndpointDispatcher.ContractNamespace,
                   shared)
        {
            DispatchRuntime = dispatchRuntime ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(dispatchRuntime));
            _shared         = shared;

            Fx.Assert(shared.IsOnServer, "Server constructor called on client?");
        }
Beispiel #4
0
        private DispatchRuntime(SharedRuntimeState shared)
        {
            _shared = shared;

            _operations                    = new OperationCollection(this);
            _synchronizationContext        = ThreadBehavior.GetCurrentSynchronizationContext();
            _automaticInputSessionShutdown = true;

            _unhandled = new DispatchOperation(this, "*", MessageHeaders.WildcardAction, MessageHeaders.WildcardAction);
        }
Beispiel #5
0
        internal DispatchRuntime(ClientRuntime proxyRuntime, SharedRuntimeState shared)
            : this(shared)
        {
            if (proxyRuntime == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("proxyRuntime");
            }

            _proxyRuntime      = proxyRuntime;
            _channelDispatcher = new ChannelDispatcher(shared);
            Fx.Assert(!shared.IsOnServer, "Client constructor called on server?");
        }
Beispiel #6
0
        private DispatchRuntime(SharedRuntimeState shared)
        {
            _shared = shared;

            _operations                    = new OperationCollection(this);
            _messageInspectors             = NewBehaviorCollection <IDispatchMessageInspector>();
            _synchronizationContext        = ThreadBehavior.GetCurrentSynchronizationContext();
            _automaticInputSessionShutdown = true;

            _unhandled = new DispatchOperation(this, "*", MessageHeaders.WildcardAction, MessageHeaders.WildcardAction);
            _unhandled.InternalFormatter = MessageOperationFormatter.Instance;
            _unhandled.InternalInvoker   = new UnhandledActionInvoker(this);
        }
 private ClientRuntime(string contractName, string contractNamespace, SharedRuntimeState shared)
 {
     this.addTransactionFlowProperties = true;
     this.useSynchronizationContext    = true;
     this.contractName                   = contractName;
     this.contractNamespace              = contractNamespace;
     this.shared                         = shared;
     this.operations                     = new OperationCollection(this);
     this.channelInitializers            = new ProxyBehaviorCollection <IChannelInitializer>(this);
     this.messageInspectors              = new ProxyBehaviorCollection <IClientMessageInspector>(this);
     this.interactiveChannelInitializers = new ProxyBehaviorCollection <IInteractiveChannelInitializer>(this);
     this.unhandled                      = new ClientOperation(this, "*", "*", "*");
     this.unhandled.InternalFormatter    = new MessageOperationFormatter();
     this.maxFaultSize                   = 0x10000;
 }
Beispiel #8
0
 private void Initialize(SharedRuntimeState shared)
 {
     _shared = shared;
     _endpointDispatchers  = new EndpointDispatcherCollection(this);
     _channelInitializers  = this.NewBehaviorCollection <IChannelInitializer>();
     _channels             = new CommunicationObjectManager <IChannel>(this.ThisLock);
     _pendingChannels      = new SynchronizedChannelCollection <IChannel>(this.ThisLock);
     _errorHandlers        = new Collection <IErrorHandler>();
     _receiveSynchronously = false;
     _transactionTimeout   = TimeSpan.Zero;
     _maxPendingReceives   = 1; //Default maxpending receives is 1;
     if (_listener != null)
     {
         _listener.Faulted += new EventHandler(OnListenerFaulted);
     }
 }
Beispiel #9
0
        private ClientRuntime(string contractName, string contractNamespace, SharedRuntimeState shared)
        {
            ContractName       = contractName;
            _contractNamespace = contractNamespace;
            _shared            = shared;

            OperationCollection operations = new OperationCollection(this);

            this.operations                 = operations;
            compatOperations                = new OperationCollectionWrapper(operations);
            _channelInitializers            = new ProxyBehaviorCollection <IChannelInitializer>(this);
            messageInspectors               = new ProxyBehaviorCollection <IClientMessageInspector>(this);
            _interactiveChannelInitializers = new ProxyBehaviorCollection <IInteractiveChannelInitializer>(this);

            UnhandledClientOperation = new ClientOperation(this, "*", MessageHeaders.WildcardAction, MessageHeaders.WildcardAction);
            UnhandledClientOperation.InternalFormatter = new MessageOperationFormatter();
            _maxFaultSize = TransportDefaults.MaxFaultSize;
        }
Beispiel #10
0
 private void Initialize(SharedRuntimeState shared)
 {
     this.shared = shared;
     this.endpointDispatchers  = new EndpointDispatcherCollection(this);
     this.channelInitializers  = this.NewBehaviorCollection <IChannelInitializer>();
     this.channels             = new CommunicationObjectManager <IChannel>(base.ThisLock);
     this.pendingChannels      = new SynchronizedChannelCollection <IChannel>(base.ThisLock);
     this.errorHandlers        = new Collection <IErrorHandler>();
     this.isTransactedReceive  = false;
     this.receiveSynchronously = false;
     this.serviceThrottle      = null;
     this.transactionTimeout   = TimeSpan.Zero;
     this.maxPendingReceives   = 1;
     if (this.listener != null)
     {
         this.listener.Faulted += new EventHandler(this.OnListenerFaulted);
     }
 }
Beispiel #11
0
 private DispatchRuntime(SharedRuntimeState shared)
 {
     this.shared     = shared;
     this.operations = new OperationCollection(this);
     this.inputSessionShutdownHandlers    = this.NewBehaviorCollection <IInputSessionShutdown>();
     this.messageInspectors               = this.NewBehaviorCollection <IDispatchMessageInspector>();
     this.instanceContextInitializers     = this.NewBehaviorCollection <IInstanceContextInitializer>();
     this.synchronizationContext          = ThreadBehavior.GetCurrentSynchronizationContext();
     this.automaticInputSessionShutdown   = true;
     this.principalPermissionMode         = System.ServiceModel.Description.PrincipalPermissionMode.UseWindowsGroups;
     this.securityAuditLogLocation        = AuditLogLocation.Default;
     this.suppressAuditFailure            = true;
     this.serviceAuthorizationAuditLevel  = AuditLevel.None;
     this.messageAuthenticationAuditLevel = AuditLevel.None;
     this.unhandled = new DispatchOperation(this, "*", "*", "*");
     this.unhandled.InternalFormatter = MessageOperationFormatter.Instance;
     this.unhandled.InternalInvoker   = new UnhandledActionInvoker(this);
 }
Beispiel #12
0
        DispatchRuntime(SharedRuntimeState shared)
        {
            this.shared = shared;

            this.operations = new OperationCollection(this);

            this.inputSessionShutdownHandlers = this.NewBehaviorCollection <IInputSessionShutdown>();
            this.messageInspectors            = this.NewBehaviorCollection <IDispatchMessageInspector>();
            this.instanceContextInitializers  = this.NewBehaviorCollection <IInstanceContextInitializer>();
            this.synchronizationContext       = ThreadBehavior.GetCurrentSynchronizationContext();

            this.automaticInputSessionShutdown = true;
            this.principalPermissionMode       = ServiceAuthorizationBehavior.DefaultPrincipalPermissionMode;

            this.securityAuditLogLocation        = ServiceSecurityAuditBehavior.defaultAuditLogLocation;
            this.suppressAuditFailure            = ServiceSecurityAuditBehavior.defaultSuppressAuditFailure;
            this.serviceAuthorizationAuditLevel  = ServiceSecurityAuditBehavior.defaultServiceAuthorizationAuditLevel;
            this.messageAuthenticationAuditLevel = ServiceSecurityAuditBehavior.defaultMessageAuthenticationAuditLevel;

            this.unhandled = new DispatchOperation(this, "*", MessageHeaders.WildcardAction, MessageHeaders.WildcardAction);
            this.unhandled.InternalFormatter = MessageOperationFormatter.Instance;
            this.unhandled.InternalInvoker   = new UnhandledActionInvoker(this);
        }
Beispiel #13
0
 internal ChannelDispatcher(SharedRuntimeState shared)
 {
     this.Initialize(shared);
 }
Beispiel #14
0
 internal ChannelDispatcher(SharedRuntimeState shared)
 {
     this.transactionIsolationLevel = ServiceBehaviorAttribute.DefaultIsolationLevel;
     this.Initialize(shared);
 }
Beispiel #15
0
 internal DispatchRuntime(System.ServiceModel.Dispatcher.ClientRuntime proxyRuntime, SharedRuntimeState shared) : this(shared)
 {
     if (proxyRuntime == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("proxyRuntime");
     }
     this.proxyRuntime            = proxyRuntime;
     this.instanceProvider        = new CallbackInstanceProvider();
     this.channelDispatcher       = new System.ServiceModel.Dispatcher.ChannelDispatcher(shared);
     this.instanceContextProvider = InstanceContextProviderBase.GetProviderForMode(InstanceContextMode.PerSession, this);
 }