BootstrapRestPackagesModule.java 文件源码

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

项目:shiro-guice-async-webapp 作者:
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected void configure() {
    logger.entry();
    String[] pkgs = GenericBootstrapConstants.REST_EASY_REST_PACKAGES.split(",");

    for(String pkg:pkgs){
        //if(pkg.trim().endsWith(GenericBootstrapConstants.REST_EASY_REST_PACKAGES_SUFFIX)){
            logger.info("found RESTful package: {}",pkg.trim());
            Class[] lst = null;
            try {
                lst = getClasses(pkg.trim());
            } catch (ClassNotFoundException | IOException e) {
                logger.error("{}, {}", e.getClass().getName() ,e.getMessage());
                e.printStackTrace();
            }
            for (Class c: lst){
                if(c.isAnnotationPresent(Path.class) || c.isAnnotationPresent(Provider.class)){
                    logger.info("found RestEasy Resource: {}",c.getName());
                    bind(c);
                }
            }
        //}
    }
    logger.exit();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号