use of com.baidu.disconf.client.common.model.DisconfCenterItem in project disconf by knightliao.
the class DisconfItemCoreProcessorImpl method inject2Conf.
/**
*/
@Override
public void inject2Conf() {
/**
* 配置ITEM列表处理
*/
for (String key : disconfStoreProcessor.getConfKeySet()) {
LOGGER.debug("==============\tstart to inject value to disconf item instance: " + key + "\t=============================");
DisconfCenterItem disconfCenterItem = (DisconfCenterItem) disconfStoreProcessor.getConfData(key);
inject2OneConf(key, disconfCenterItem);
}
}
use of com.baidu.disconf.client.common.model.DisconfCenterItem in project disconf by knightliao.
the class DisconfItemCoreProcessorImpl method processOneItem.
@Override
public void processOneItem(String key) {
LOGGER.debug("==============\tstart to process disconf item: " + key + "\t=============================");
DisconfCenterItem disconfCenterItem = (DisconfCenterItem) disconfStoreProcessor.getConfData(key);
if (disconfCenterItem != null) {
try {
updateOneConfItem(key, disconfCenterItem);
} catch (Exception e) {
LOGGER.error(e.toString(), e);
}
}
}
use of com.baidu.disconf.client.common.model.DisconfCenterItem in project disconf by knightliao.
the class DisconfDataGetterDefaultImpl method getByItem.
@Override
public Object getByItem(String itemName) {
DisconfStoreProcessor disconfStoreProcessor = DisconfStoreProcessorFactory.getDisconfStoreItemProcessor();
DisconfCenterItem disconfCenterItem = (DisconfCenterItem) disconfStoreProcessor.getConfData(itemName);
if (disconfCenterItem == null) {
return null;
}
return disconfCenterItem.getValue();
}
use of com.baidu.disconf.client.common.model.DisconfCenterItem in project disconf by knightliao.
the class DisconfCenterStore method storeOneItem.
/**
* 存储 一个配置项
*/
public void storeOneItem(DisconfCenterBaseModel disconfCenterBaseModel) {
DisconfCenterItem disconfCenterItem = (DisconfCenterItem) disconfCenterBaseModel;
String key = disconfCenterItem.getKey();
if (confItemMap.containsKey(key)) {
LOGGER.error("There are two same item key!!!! " + "first: " + confItemMap.get(key).getClass().toString() + ", Second: " + disconfCenterItem.getClass().toString());
} else {
confItemMap.put(key, disconfCenterItem);
}
}
use of com.baidu.disconf.client.common.model.DisconfCenterItem in project disconf by knightliao.
the class StaticScannerItemMgrImpl method getDisconfItems.
/**
* 转换配置项
*/
private static List<DisconfCenterBaseModel> getDisconfItems(ScanStaticModel scanModel) {
List<DisconfCenterBaseModel> disconfCenterItems = new ArrayList<DisconfCenterBaseModel>();
Set<Method> methods = scanModel.getDisconfItemMethodSet();
for (Method method : methods) {
DisconfCenterItem disconfCenterItem = transformScanItem(method);
if (disconfCenterItem != null) {
disconfCenterItems.add(disconfCenterItem);
}
}
return disconfCenterItems;
}
Aggregations