Пример #1
0
        public CorrelatingRemotingMessageHandler(ServiceContext serviceContext, IService service)
        {
            this.serviceContext = serviceContext;

            // Populate our method name provider with methods from the IService interfaces
            methodNameProvider = new MethodNameProvider(false /* threadSafe */);
            methodNameProvider.AddMethodsForProxyOrService(service.GetType().GetInterfaces(), typeof(IService));

            innerHandler = new ServiceRemotingDispatcher(serviceContext, service);
        }
        public CorrelatingServiceProxyFactory(Func <IServiceRemotingCallbackClient, IServiceRemotingClientFactory> createServiceRemotingClientFactory = null, OperationRetrySettings retrySettings = null)
        {
            methodNameProvider = new MethodNameProvider(true /* threadSafe */);

            // Layer the factory structure so the hierarchy will look like this:
            // CorrelatingServiceProxyFactory
            //  --> ServiceProxyFactory
            //      --> CorrelatingServiceRemotingFactory
            //          --> <Factory created by createServcieRemotingClientFactory>
            serviceProxyFactory = new ServiceProxyFactory(
                callbackClient =>
            {
                IServiceRemotingClientFactory innerClientFactory = createServiceRemotingClientFactory(callbackClient);
                return(new CorrelatingServiceRemotingClientFactory(innerClientFactory, methodNameProvider));
            },
                retrySettings);
        }