use of com.baidu.disconf.client.scan.inner.dynamic.model.ScanDynamicModel in project disconf by knightliao.
the class ScanDynamicStoreAdapter method scanUpdateCallbacks.
/**
* 扫描更新回调函数
*/
public static void scanUpdateCallbacks(ScanStaticModel scanModel, Registry registry) {
// 扫描出来
ScanDynamicModel scanDynamicModel = analysis4DisconfUpdate(scanModel, registry);
// 写到仓库中
transformUpdateService(scanDynamicModel.getDisconfUpdateServiceInverseIndexMap());
transformPipelineService(scanDynamicModel.getDisconfUpdatePipeline());
}
use of com.baidu.disconf.client.scan.inner.dynamic.model.ScanDynamicModel in project disconf by knightliao.
the class ScanDynamicStoreAdapter method analysis4DisconfUpdate.
/**
* 第二次扫描, 获取更新 回调的实例<br/>
* <p/>
* 分析出更新操作的相关配置文件内容
*/
private static ScanDynamicModel analysis4DisconfUpdate(ScanStaticModel scanModel, Registry registry) {
// 配置项或文件
Map<DisconfKey, List<IDisconfUpdate>> inverseMap = new HashMap<DisconfKey, List<IDisconfUpdate>>();
Set<Class<?>> disconfUpdateServiceSet = scanModel.getDisconfUpdateService();
for (Class<?> disconfUpdateServiceClass : disconfUpdateServiceSet) {
// 回调对应的参数
DisconfUpdateService disconfUpdateService = disconfUpdateServiceClass.getAnnotation(DisconfUpdateService.class);
// 校验是否有继承正确,是否继承IDisconfUpdate
if (!ScanVerify.hasIDisconfUpdate(disconfUpdateServiceClass)) {
continue;
}
//
// 获取回调接口实例
IDisconfUpdate iDisconfUpdate = getIDisconfUpdateInstance(disconfUpdateServiceClass, registry);
if (iDisconfUpdate == null) {
continue;
}
//
// 配置项
processItems(inverseMap, disconfUpdateService, iDisconfUpdate);
//
// 配置文件
processFiles(inverseMap, disconfUpdateService, iDisconfUpdate);
}
// set data
ScanDynamicModel scanDynamicModel = new ScanDynamicModel();
scanDynamicModel.setDisconfUpdateServiceInverseIndexMap(inverseMap);
//
if (scanModel.getiDisconfUpdatePipeline() != null) {
IDisconfUpdatePipeline iDisconfUpdatePipeline = getIDisconfUpdatePipelineInstance(scanModel.getiDisconfUpdatePipeline(), registry);
if (iDisconfUpdatePipeline != null) {
scanDynamicModel.setDisconfUpdatePipeline(iDisconfUpdatePipeline);
}
}
return scanDynamicModel;
}
Aggregations