本文整理匯總了Java中com.baidu.disconf.client.common.annotations.DisconfUpdateService類的典型用法代碼示例。如果您正苦於以下問題:Java DisconfUpdateService類的具體用法?Java DisconfUpdateService怎麽用?Java DisconfUpdateService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DisconfUpdateService類屬於com.baidu.disconf.client.common.annotations包,在下文中一共展示了DisconfUpdateService類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processItems
import com.baidu.disconf.client.common.annotations.DisconfUpdateService; //導入依賴的package包/類
/**
* 獲取回調對應配置項列表
*/
private static void processItems(Map<DisconfKey, List<IDisconfUpdate>> inverseMap,
DisconfUpdateService disconfUpdateService, IDisconfUpdate iDisconfUpdate) {
List<String> itemKeys = Arrays.asList(disconfUpdateService.itemKeys());
// 反索引
for (String key : itemKeys) {
DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.ITEM, key);
addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
}
}
示例2: analysis4DisconfUpdate
import com.baidu.disconf.client.common.annotations.DisconfUpdateService; //導入依賴的package包/類
/**
* 第二次掃描, 獲取更新 回調的實例<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);
//
// set update pipeline
//
if (scanModel.getiDisconfUpdatePipeline() != null) {
IDisconfUpdatePipeline iDisconfUpdatePipeline = getIDisconfUpdatePipelineInstance(scanModel
.getiDisconfUpdatePipeline(), registry);
if (iDisconfUpdatePipeline != null) {
scanDynamicModel.setDisconfUpdatePipeline(iDisconfUpdatePipeline);
}
}
return scanDynamicModel;
}
示例3: scanBasicInfo
import com.baidu.disconf.client.common.annotations.DisconfUpdateService; //導入依賴的package包/類
/**
* 掃描基本信息
*/
private ScanStaticModel scanBasicInfo(List<String> packNameList) {
ScanStaticModel scanModel = new ScanStaticModel();
//
// 掃描對象
//
Reflections reflections = getReflection(packNameList);
scanModel.setReflections(reflections);
//
// 獲取DisconfFile class
//
Set<Class<?>> classdata = reflections.getTypesAnnotatedWith(DisconfFile.class);
scanModel.setDisconfFileClassSet(classdata);
//
// 獲取DisconfFileItem method
//
Set<Method> af1 = reflections.getMethodsAnnotatedWith(DisconfFileItem.class);
scanModel.setDisconfFileItemMethodSet(af1);
//
// 獲取DisconfItem method
//
af1 = reflections.getMethodsAnnotatedWith(DisconfItem.class);
scanModel.setDisconfItemMethodSet(af1);
//
// 獲取DisconfActiveBackupService
//
classdata = reflections.getTypesAnnotatedWith(DisconfActiveBackupService.class);
scanModel.setDisconfActiveBackupServiceClassSet(classdata);
//
// 獲取DisconfUpdateService
//
classdata = reflections.getTypesAnnotatedWith(DisconfUpdateService.class);
scanModel.setDisconfUpdateService(classdata);
// update pipeline
Set<Class<? extends IDisconfUpdatePipeline>> iDisconfUpdatePipeline = reflections.getSubTypesOf
(IDisconfUpdatePipeline
.class);
if (iDisconfUpdatePipeline != null && iDisconfUpdatePipeline.size() != 0) {
scanModel.setiDisconfUpdatePipeline((Class<IDisconfUpdatePipeline>) iDisconfUpdatePipeline
.toArray()[0]);
}
return scanModel;
}