clean code,remove repeat code
This commit is contained in:
parent
ab21d983af
commit
acc4e337d2
@ -49,21 +49,14 @@ public class ConfigFactory {
|
|||||||
/**
|
/**
|
||||||
* Create Config
|
* Create Config
|
||||||
*
|
*
|
||||||
* @param ServerAddr serverlist
|
* @param serverAddr serverlist
|
||||||
* @return Config
|
* @return Config
|
||||||
* @throws NacosException Exception
|
* @throws NacosException Exception
|
||||||
*/
|
*/
|
||||||
public static ConfigService createConfigService(String serverAddr) throws NacosException {
|
public static ConfigService createConfigService(String serverAddr) throws NacosException {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
|
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
|
||||||
try {
|
return createConfigService(properties);
|
||||||
Class<?> driverImplClass = Class.forName("com.alibaba.nacos.client.config.NacosConfigService");
|
|
||||||
Constructor constructor = driverImplClass.getConstructor(Properties.class);
|
|
||||||
ConfigService vendorImpl = (ConfigService)constructor.newInstance(properties);
|
|
||||||
return vendorImpl;
|
|
||||||
} catch (Throwable e) {
|
|
||||||
throw new NacosException(-400, e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ package com.alibaba.nacos.api.config.listener;
|
|||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listner Adapter,use default notify thread
|
* Listener Adapter,use default notify thread
|
||||||
*
|
*
|
||||||
* @author water.lyl
|
* @author water.lyl
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user