//
Set<Class<?>> disconfUpdateServiceSet = scanModel
.getDisconfUpdateService();
for (Class<?> disconfUpdateServiceClass : disconfUpdateServiceSet) {
DisconfUpdateService disconfUpdateService = disconfUpdateServiceClass
.getAnnotation(DisconfUpdateService.class);
//
// 校验是否有继承正确,是否继承IDisconfUpdate
//
if (!ScanVerify.hasIDisconfUpdate(disconfUpdateServiceClass)) {
continue;
}
//
// 回调函数需要实例化出来,这里
// 非Spring直接New
// Spring要GetBean
//
IDisconfUpdate iDisconfUpdate = null;
//
// Spring方式
try {
iDisconfUpdate = getSpringBean(disconfUpdateServiceClass);
} catch (Exception e) {
LOGGER.warn(e.toString());
}
//
// 非Spring方式
if (iDisconfUpdate == null) {
try {
iDisconfUpdate = (IDisconfUpdate) disconfUpdateServiceClass
.newInstance();
} catch (Exception e) {
LOGGER.error("Your class "
+ disconfUpdateServiceClass.toString()
+ " cannot new instance. " + e.toString());
continue;
}
}
//
// 配置项
//
List<String> itemKeys = Arrays.asList(disconfUpdateService
.itemKeys());
// 反索引
for (String key : itemKeys) {
DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.ITEM,
key);
addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
}
//
// 配置文件
//
List<Class<?>> classes = Arrays.asList(disconfUpdateService
.classes());
// 反索引
for (Class<?> curClass : classes) {