format code

pull/931/head
zkzlx 5 years ago
parent e774cbe74d
commit 9ab9141895

@ -30,8 +30,7 @@ import org.springframework.context.ApplicationContextAware;
* @author <a href="mailto:liaochunyhm@live.com">liaochuntao</a> * @author <a href="mailto:liaochunyhm@live.com">liaochuntao</a>
*/ */
public class NacosConfigManager implements ApplicationContextAware { public class NacosConfigManager implements ApplicationContextAware {
private static final Logger log = LoggerFactory private static final Logger log = LoggerFactory.getLogger(NacosConfigManager.class);
.getLogger(NacosConfigManager.class);
private ConfigService configService; private ConfigService configService;
public ConfigService getConfigService() { public ConfigService getConfigService() {
@ -44,9 +43,11 @@ public class NacosConfigManager implements ApplicationContextAware {
NacosConfigProperties properties = applicationContext NacosConfigProperties properties = applicationContext
.getBean(NacosConfigProperties.class); .getBean(NacosConfigProperties.class);
try { try {
configService = NacosFactory.createConfigService(properties.getConfigServiceProperties()); configService = NacosFactory
.createConfigService(properties.getConfigServiceProperties());
properties.initConfigService(configService); properties.initConfigService(configService);
} catch (NacosException e) { }
catch (NacosException e) {
log.error("create config service error!properties={},e=,", properties, e); log.error("create config service error!properties={},e=,", properties, e);
} }
} }

@ -411,11 +411,11 @@ public class NacosConfigProperties {
return configService; return configService;
} }
public void initConfigService(ConfigService configService){ public void initConfigService(ConfigService configService) {
this.configService = configService; this.configService = configService;
} }
public Properties getConfigServiceProperties(){ public Properties getConfigServiceProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
properties.put(SERVER_ADDR, Objects.toString(this.serverAddr, "")); properties.put(SERVER_ADDR, Objects.toString(this.serverAddr, ""));
properties.put(ENCODE, Objects.toString(this.encode, "")); properties.put(ENCODE, Objects.toString(this.encode, ""));

Loading…
Cancel
Save