Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="configContext"></param>
        /// <param name="section"></param>
        /// <returns></returns>
        public object Create(object parent, object configContext, XmlNode section)
        {
            if (Instance != null)
            {
                return(Instance);
            }

            Instance = RpcConfigHelper.GetConfig(new XmlConfigurationSection(section));

            return(Instance);
        }
Пример #2
0
        /// <summary>
        /// get RpcLiteConfig from IConfiguration
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public RpcConfig GetConfig(IConfiguration config)
        {
            var instance = new RpcConfig
            {
                AppId   = config["appId"],
                Group   = config["environment"],
                Version = RpcConfigHelper.GetVersion(config),
            };

            //InitializeResolverConfig(config, instance);
            InitializeServiceConfig(config, instance);
            InitializeClientConfig(config, instance);

            return(instance);
        }
Пример #3
0
        /// <summary>
        /// initialize from configuration
        /// </summary>
        /// <param name="config"></param>
        public static void Initialize(CoreConfig.IConfiguration config)
        {
            var rpcConfig = RpcConfigHelper.GetConfig(new CoreConfigurationSection(config));

            Initialize(rpcConfig);
        }
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="address"></param>
 public RegistryConfig(string name, Type type, string address)
 {
     Name    = name;
     Type    = RpcConfigHelper.GetTypeIdentifier(type);
     Address = address;
 }
Пример #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 public ChannelProviderConfig(string name, Type type)
 {
     Name = name;
     Type = RpcConfigHelper.GetTypeIdentifier(type);
 }
Пример #6
0
        //public IDictionary<string,string> Items { get; set; }

        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        public InvokerConfig(string name, Type type)
        {
            Name = name;
            Type = RpcConfigHelper.GetTypeIdentifier(type);
        }
Пример #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 public FilterItemConfig(string name, Type type)
 {
     Name = name;
     Type = RpcConfigHelper.GetTypeIdentifier(type);
 }
Пример #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 /// <param name="path"></param>
 public ServiceConfigItem(string name, Type type, string path)
 {
     Name = name;
     Type = RpcConfigHelper.GetTypeIdentifier(type);
     Path = path;
 }
Пример #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="type"></param>
 public ServiceMapperConfig(string name, Type type)
 {
     Name = name;
     Type = RpcConfigHelper.GetTypeIdentifier(type);
 }
Пример #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name">service name</param>
 /// <param name="type">contract type</param>
 /// <param name="address"></param>
 public ClientConfigItem(string name, Type type, string address)
 {
     Name    = name;
     Type    = RpcConfigHelper.GetTypeIdentifier(type);
     Address = address;
 }