use of com.baidu.disconf.client.common.model.DisconfCenterFile in project disconf by knightliao.
the class DisconfFileCoreProcessorImpl method inject2Conf.
@Override
public void inject2Conf() {
/**
* 配置文件列表处理
*/
for (String key : disconfStoreProcessor.getConfKeySet()) {
LOGGER.debug("==============\tstart to inject value to disconf file item instance: " + key + "\t=============================");
DisconfCenterFile disconfCenterFile = (DisconfCenterFile) disconfStoreProcessor.getConfData(key);
inject2OneConf(key, disconfCenterFile);
}
}
use of com.baidu.disconf.client.common.model.DisconfCenterFile in project disconf by knightliao.
the class DisconfFileCoreProcessorImpl method processOneItem.
@Override
public void processOneItem(String key) {
LOGGER.debug("==============\tstart to process disconf file: " + key + "\t=============================");
DisconfCenterFile disconfCenterFile = (DisconfCenterFile) disconfStoreProcessor.getConfData(key);
try {
updateOneConfFile(key, disconfCenterFile);
} catch (Exception e) {
LOGGER.error(e.toString(), e);
}
}
use of com.baidu.disconf.client.common.model.DisconfCenterFile in project disconf by knightliao.
the class DisconfFileCoreProcessorImpl method updateOneConf.
/**
* 更新消息:某个配置文件
*/
private void updateOneConf(String fileName) throws Exception {
DisconfCenterFile disconfCenterFile = (DisconfCenterFile) disconfStoreProcessor.getConfData(fileName);
if (disconfCenterFile != null) {
// 更新仓库
updateOneConfFile(fileName, disconfCenterFile);
// 更新实例
inject2OneConf(fileName, disconfCenterFile);
}
}
use of com.baidu.disconf.client.common.model.DisconfCenterFile in project disconf by knightliao.
the class DisconfDataGetterDefaultImpl method getByFile.
@Override
public Map<String, Object> getByFile(String fileName) {
DisconfStoreProcessor disconfStoreProcessor = DisconfStoreProcessorFactory.getDisconfStoreFileProcessor();
DisconfCenterFile disconfCenterFile = (DisconfCenterFile) disconfStoreProcessor.getConfData(fileName);
if (disconfCenterFile == null) {
return new HashMap<String, Object>();
}
return disconfCenterFile.getKV();
}
use of com.baidu.disconf.client.common.model.DisconfCenterFile in project disconf by knightliao.
the class DisconfCenterStore method storeOneFile.
/**
* 存储 一个配置文件
*/
public void storeOneFile(DisconfCenterBaseModel disconfCenterBaseModel) {
DisconfCenterFile disconfCenterFile = (DisconfCenterFile) disconfCenterBaseModel;
String fileName = disconfCenterFile.getFileName();
if (confFileMap.containsKey(fileName)) {
LOGGER.warn("There are two same fileName key!!!! " + fileName);
DisconfCenterFile existCenterFile = confFileMap.get(fileName);
// 如果是 同时使用了 注解式 和 非注解式 两种方式,则当修改时也要 进行 XML 式 reload
if (disconfCenterFile.isTaggedWithNonAnnotationFile()) {
existCenterFile.setIsTaggedWithNonAnnotationFile(true);
}
} else {
confFileMap.put(fileName, disconfCenterFile);
}
}
Aggregations