InventoryFacadeImpl.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:zstack 作者:
@Override
public boolean start() {
    try {
        ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(true);
        scanner.addIncludeFilter(new AnnotationTypeFilter(Inventory.class));
        scanner.addExcludeFilter(new AnnotationTypeFilter(Controller.class));
        scanner.addExcludeFilter(new AnnotationTypeFilter(org.springframework.stereotype.Component.class));
        for (String pkg : getBasePkgNames()) {
            for (BeanDefinition bd : scanner.findCandidateComponents(pkg)) {
                Class<?> inventoryClass = Class.forName(bd.getBeanClassName());
                Inventory invat = inventoryClass.getAnnotation(Inventory.class);
                Info info = new Info();
                info.inventory = invat;
                info.inventoryClass = inventoryClass;
                inventoryMapping.put(invat.mappingVOClass(), info);
            }
        }
    } catch (Exception e) {
        throw new CloudRuntimeException(e);
    }
    return true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号