Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="factory"></param>
        /// <param name="config"></param>
        public DefaultServiceMapper(RpcServiceFactory factory, RpcConfig config)
        {
            if (factory == null)
                throw new ArgumentNullException(nameof(factory));

            if (config == null)
                throw new ArgumentNullException(nameof(config));

            _config = config;
            _factory = factory;
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="factory"></param>
        /// <param name="config"></param>
        public DefaultServiceMapper(RpcServiceFactory factory, RpcConfig config)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            _config  = config;
            _factory = factory;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        public ServiceHost(AppHost appHost, RpcConfig config)
        {
            _config = config;
            _appHost = appHost;

            _serviceFactory = new RpcServiceFactory(_appHost, config);

            _initializeRegistry = new Lazy<object>(() =>
            {
                var services = _config?.Service?.Services;
                if (services == null || _appHost.Registry?.CanRegister != true)
                    return null;

                foreach (var service in services)
                {
                    _appHost.Registry.RegisterAsync(service.ToServiceInfo());
                }

                return null;
            });
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        public ServiceHost(AppHost appHost, RpcConfig config)
        {
            _config  = config;
            _appHost = appHost;

            _serviceFactory = new RpcServiceFactory(_appHost, config);

            _initializeRegistry = new Lazy <object>(() =>
            {
                var services = _config?.Service?.Services;
                if (services == null || _appHost.Registry?.CanRegister != true)
                {
                    return(null);
                }

                foreach (var service in services)
                {
                    _appHost.Registry.RegisterAsync(service.ToServiceInfo());
                }

                return(null);
            });
        }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public IServiceMapper CreateServiceMapper(RpcServiceFactory factory, RpcConfig config)
 {
     return(new DefaultServiceMapper(factory, config));
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public IServiceMapper CreateServiceMapper(RpcServiceFactory factory, RpcConfig config)
 {
     return new DefaultServiceMapper(factory, config);
 }