SpringResourceLoader.java 文件源码

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

项目:rice 作者:
@Override
public void start() throws Exception {
    if(!isStarted()){
        LOG.info("Creating Spring context " + StringUtils.join(this.fileLocs, ","));
        if (parentSpringResourceLoader != null && parentContext != null) {
            throw new ConfigurationException("Both a parentSpringResourceLoader and parentContext were defined.  Only one can be defined!");
        }
        if (parentSpringResourceLoader != null) {
            parentContext = parentSpringResourceLoader.getContext();
        }

        if (servletContextcontext != null) {
            XmlWebApplicationContext lContext = new XmlWebApplicationContext();
            lContext.setServletContext(servletContextcontext);
            lContext.setParent(parentContext);
            lContext.setConfigLocations(this.fileLocs.toArray(new String[] {}));
            lContext.refresh();
            context = lContext;
        } else {
            this.context = new ClassPathXmlApplicationContext(this.fileLocs.toArray(new String[] {}), parentContext);
        }

        super.start();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号