Search in sources :

Example 1 with DisconfActiveBackupService

use of com.baidu.disconf.client.common.annotations.DisconfActiveBackupService in project disconf by knightliao.

the class ReflectionScanStatic method scanBasicInfo.

/**
     * 扫描基本信息
     */
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;
}
Also used : DisconfActiveBackupService(com.baidu.disconf.client.common.annotations.DisconfActiveBackupService) IDisconfUpdatePipeline(com.baidu.disconf.client.common.update.IDisconfUpdatePipeline) ScanStaticModel(com.baidu.disconf.client.scan.inner.statically.model.ScanStaticModel) Method(java.lang.reflect.Method) DisconfUpdateService(com.baidu.disconf.client.common.annotations.DisconfUpdateService) Reflections(org.reflections.Reflections) DisconfItem(com.baidu.disconf.client.common.annotations.DisconfItem)

Aggregations

DisconfActiveBackupService (com.baidu.disconf.client.common.annotations.DisconfActiveBackupService)1 DisconfItem (com.baidu.disconf.client.common.annotations.DisconfItem)1 DisconfUpdateService (com.baidu.disconf.client.common.annotations.DisconfUpdateService)1 IDisconfUpdatePipeline (com.baidu.disconf.client.common.update.IDisconfUpdatePipeline)1 ScanStaticModel (com.baidu.disconf.client.scan.inner.statically.model.ScanStaticModel)1 Method (java.lang.reflect.Method)1 Reflections (org.reflections.Reflections)1