示例#1
0
        protected override MethodDispatcherBuildResult BuildMethodDispatcher(Type interfaceType)
        {
            var servicenterfaceDescription = ServiceInterfaceDescription.CreateUsingCRCId(interfaceType, true);
            var res = this.BuildMethodDispatcherResult(servicenterfaceDescription);

            return(res);
        }
示例#2
0
        internal ProxyGeneratorBuildResult BuildProxyGeneratorForNonMarkerInterface(Type interfaceType)
        {
            // create all base interfaces that this interface derives from
            var serviceInterfaces = new List <Type>()
            {
            };

            serviceInterfaces.AddRange(interfaceType.GetAllBaseInterfaces());

            // create interface descriptions for all interfaces
            var servicenterfaceDescriptions = serviceInterfaces.Select <Type, InterfaceDescription>(
                (t) => ServiceInterfaceDescription.CreateUsingCRCId(t, false));

            var res = this.CreateProxyGeneratorBuildResult(interfaceType, servicenterfaceDescriptions);

            return(res);
        }
示例#3
0
        protected override ProxyGeneratorBuildResult BuildProxyGenerator(Type interfaceType)
        {
            // create all service interfaces that this interface derives from
            var serviceInterfaces = new List <Type>()
            {
                interfaceType
            };

            serviceInterfaces.AddRange(interfaceType.GetServiceInterfaces());

            // create interface descriptions for all interfaces
            var servicenterfaceDescriptions = serviceInterfaces.Select <Type, InterfaceDescription>(
                (t) => ServiceInterfaceDescription.CreateUsingCRCId(t, true));

            var res = this.CreateProxyGeneratorBuildResult(interfaceType, servicenterfaceDescriptions);

            return(res);
        }
        private void Initialize(ServiceContext serviceContext, object serviceImplementation,
                                IEnumerable <Type> remotedInterfaces, bool nonServiceInterface,
                                IServiceRemotingMessageBodyFactory serviceRemotingMessageBodyFactory)
        {
            this.serviceRemotingMessageBodyFactory = serviceRemotingMessageBodyFactory ?? new DataContractRemotingMessageFactory();

            this.cancellationHelper = new ServiceRemotingCancellationHelper(serviceContext.TraceId);

            this.methodDispatcherMap   = new Dictionary <int, MethodDispatcherBase>();
            this.serviceImplementation = serviceImplementation;

            if (serviceImplementation != null)
            {
                var interfaceDescriptions = new List <ServiceInterfaceDescription>();
                foreach (var interfaceType in remotedInterfaces)
                {
                    MethodDispatcherBase methodDispatcher;
                    if (nonServiceInterface)
                    {
                        methodDispatcher = ServiceCodeBuilder.GetOrCreateMethodDispatcherForNonMarkerInterface(interfaceType);
                        interfaceDescriptions.Add(ServiceInterfaceDescription.CreateUsingCRCId(interfaceType, false));
                    }
                    else
                    {
                        methodDispatcher = ServiceCodeBuilder.GetOrCreateMethodDispatcher(interfaceType);
                        interfaceDescriptions.Add(ServiceInterfaceDescription.CreateUsingCRCId(interfaceType, true));
                    }
                    this.methodDispatcherMap.Add(methodDispatcher.InterfaceId, methodDispatcher);
                }

                this.servicePerformanceCounterProvider =
                    new ServicePerformanceCounterProvider(serviceContext.PartitionId,
                                                          serviceContext.ReplicaOrInstanceId,
                                                          interfaceDescriptions,
                                                          false);
            }
        }
示例#5
0
        private MethodDispatcherBuildResult BuildMethodDispatcherForNonServiceInterface(Type interfaceType)
        {
            var servicenterfaceDescription = ServiceInterfaceDescription.CreateUsingCRCId(interfaceType, false);

            return(this.BuildMethodDispatcherResult(servicenterfaceDescription));
        }