Beispiel #1
0
 public ZookeeperConfigurationProvider(ConfigurationCenterOptions configurationCenterOptions, String node = null)
 {
     Guard.ArgumentNotNull(configurationCenterOptions, nameof(configurationCenterOptions));
     if (configurationCenterOptions.ConnectionString.IsNullOrWhiteSpace())
     {
         throw new ArgumentException($@"配置中心缺少连接字符串配置(configuration section: configuration : {nameof(ZookeeperClientSettings.ConnectionString)})。");
     }
     _options  = configurationCenterOptions;
     _nodeName = node.IfNullOrWhiteSpace("application");
     _rootNode = _options.NodeBasePath;
     if (_rootNode?.IndexOf('{') >= 0)
     {
         _rootNode = "";
     }
 }
 public ZookeeperConfigurationSource(ConfigurationCenterOptions options, String customConfigFile = null)
 {
     _options          = options;
     _customConfigFile = customConfigFile;
 }