Eureka源码分析(三) DefaultEurekaServe

2018-11-09  本文已影响0人  skyguard

之前我们分析了eureka client的配置,现在我们就来分析一下eureka server的配置。先来介绍一个类DefaultEurekaServerConfig,这个类实现了EurekaServerConfig接口,是EurekaServerConfig的默认实现类。我们来看一下DefaultEurekaServerConfig都有哪些属性

     // 初始化 配置文件对象
     String env = ConfigurationManager.getConfigInstance().getString(EUREKA_ENVIRONMENT, TEST);
     ConfigurationManager.getConfigInstance().setProperty(ARCHAIUS_DEPLOYMENT_ENVIRONMENT, env);
     String eurekaPropsFile = EUREKA_PROPS_FILE.get();
     try {
         // ConfigurationManager
         // .loadPropertiesFromResources(eurekaPropsFile);
         ConfigurationManager.loadCascadedPropertiesFromResources(eurekaPropsFile);
     } catch (IOException e) {
         logger.warn("Cannot find the properties specified : {}. This may be okay if there are other environment "
                         + "specific properties or the configuration is installed with a different mechanism.", eurekaPropsFile);
     }
 }

DefaultEurekaServerConfig就分析到这里了。

上一篇 下一篇

猜你喜欢

热点阅读