Esempio n. 1
0
 public ServiceImplementationFactory(IServiceDescriptionBuilder serviceDescriptionBuilder, IRpcClientServer clientServer,
                                     IEnumerable <InterfaceImplementationTypePair> interfaceImplementationTypePairs)
 {
     this.serviceDescriptionBuilder = serviceDescriptionBuilder;
     this.clientServer = clientServer;
     constructors      = new ConcurrentDictionary <string, ImplementationCreationInfo>(interfaceImplementationTypePairs.Select(ConvertPair));
 }
 public ServiceImplementationFactory(IServiceDescriptionBuilder serviceDescriptionBuilder, IRpcClientServer clientServer, 
     IEnumerable<InterfaceImplementationTypePair> interfaceImplementationTypePairs)
 {
     this.serviceDescriptionBuilder = serviceDescriptionBuilder;
     this.clientServer = clientServer;
     constructors = new ConcurrentDictionary<string, ImplementationCreationInfo>(interfaceImplementationTypePairs.Select(ConvertPair));
 }
Esempio n. 3
0
        public ServiceDescription BuildServiceDescription(out IDictionary <string, ContractDescription> implementedContracts, out IList <Type> reflectedContracts)
        {
            ServiceDescriptionContext context = new ServiceDescriptionContext();

            ServiceDescription description = new ServiceDescription();

            ApplyBehaviors(description);

            context.ServiceDescription = description;

            Walker walker = new Walker(true);

            walker.FoundActivity += delegate(Walker w, WalkerEventArgs args)
            {
                IServiceDescriptionBuilder activity = args.CurrentActivity as IServiceDescriptionBuilder;
                if (activity == null)
                {
                    return;
                }

                activity.BuildServiceDescription(context);
            };

            walker.Walk(this.workflowDefinitionContext.GetWorkflowDefinition());

            if (context.Contracts == null || context.Contracts.Count == 0)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR2.GetString(SR2.NoContract)));
            }

            implementedContracts = context.Contracts;
            reflectedContracts   = context.ReflectedContracts;
            return(description);
        }
 public void Setup()
 {
     serviceDescriptionBuilder = new ServiceDescriptionBuilder(new MethodDescriptionBuilder());
     codecContainer            = new CodecContainer();
     requestProcessor          = Substitute.For <IOutgoingRequestProcessor>();
     factory = new ProxyFactory(serviceDescriptionBuilder, codecContainer);
 }
 public void Setup()
 {
     serviceDescriptionBuilder = new ServiceDescriptionBuilder(new MethodDescriptionBuilder());
     codecContainer            = new CodecContainer();
     methodCallProcessor       = Substitute.For <IOutgoingMethodCallProcessor>();
     factory = new ServiceProxyClassFactory(serviceDescriptionBuilder, codecContainer);
 }
Esempio n. 6
0
        public ProxyFactory(IServiceDescriptionBuilder serviceDescriptionBuilder, ICodecContainer codecContainer)
        {
            this.serviceDescriptionBuilder = serviceDescriptionBuilder;
            this.codecContainer            = codecContainer;
            var appDomain       = AppDomain.CurrentDomain;
            var assemblyBuilder = appDomain.DefineDynamicAssembly(new AssemblyName("SharpRpcServiceProxies"), AssemblyBuilderAccess.Run);

            moduleBuilder = assemblyBuilder.DefineDynamicModule("SharpRpcServiceProxyModule");
        }
Esempio n. 7
0
 public IServiceDescriptionBuilder GetServiceDescriptionBuilder()
 {
     return(serviceDescriptionBuilder ?? (serviceDescriptionBuilder = new ServiceDescriptionBuilder(new MethodDescriptionBuilder())));
 }
 public void Setup()
 {
     serviceDescription = new ServiceDescription(typeof(IMyService), "MyService", new SubserviceDescription[0],
         new[] {new MethodDescription(typeof(void), "DoSomething", new MethodParameterDescription[0])});
     serviceDescriptionBuilder = Substitute.For<IServiceDescriptionBuilder>();
     serviceDescriptionBuilder.Build(typeof(IMyService)).Returns(serviceDescription);
     container = new ServiceImplementationContainer(serviceDescriptionBuilder);
 }
 public IServiceDescriptionBuilder GetServiceDescriptionBuilder()
 {
     return serviceDescriptionBuilder ?? (serviceDescriptionBuilder =
                                          overrides.ServiceDescriptionBuilder != null
                                              ? overrides.ServiceDescriptionBuilder(this)
                                              : new ServiceDescriptionBuilder(GetMethodDescriptionBuilder()));
 }
 public ServiceImplementationContainer(IServiceDescriptionBuilder serviceDescriptionBuilder)
 {
     this.serviceDescriptionBuilder = serviceDescriptionBuilder;
     implementations = new ConcurrentDictionary<string, ImplementationSet>();
 }
 public void Setup()
 {
     serviceDescriptionBuilder = new ServiceDescriptionBuilder(new MethodDescriptionBuilder());
     codecContainer = new CodecContainer();
     methodCallProcessor = Substitute.For<IOutgoingMethodCallProcessor>();
     factory = new ServiceProxyClassFactory(serviceDescriptionBuilder, codecContainer);
 }
 public IServiceDescriptionBuilder GetServiceDescriptionBuilder()
 {
     return serviceDescriptionBuilder ?? (serviceDescriptionBuilder = new ServiceDescriptionBuilder(new MethodDescriptionBuilder()));
 }