当前位置: 首页>>代码示例>>Java>>正文


Java DisconfUpdateService类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:knightliao,项目名称:disconf,代码行数:16,代码来源:ScanDynamicStoreAdapter.java

示例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;
}
 
开发者ID:knightliao,项目名称:disconf,代码行数:58,代码来源:ScanDynamicStoreAdapter.java

示例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;
}
 
开发者ID:knightliao,项目名称:disconf,代码行数:55,代码来源:ReflectionScanStatic.java


注:本文中的com.baidu.disconf.client.common.annotations.DisconfUpdateService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。