BundleFactoryBean.java 文件源码

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

项目:gemini.blueprint 作者:
/**
 * Install bundle - the equivalent of install action.
 * 
 * @return
 * @throws BundleException
 */
private Bundle installBundle() throws BundleException {
    Assert.hasText(location, "location parameter required when installing a bundle");

    // install bundle (default)
    log.info("Loading bundle from [" + location + "]");

    Bundle bundle = null;
    boolean installBasedOnLocation = (resource == null);

    if (!installBasedOnLocation) {
        InputStream stream = null;
        try {
            stream = resource.getInputStream();
        } catch (IOException ex) {
            // catch it since we fallback on normal install
            installBasedOnLocation = true;
        }
        if (!installBasedOnLocation)
            bundle = bundleContext.installBundle(location, stream);
    }

    if (installBasedOnLocation)
        bundle = bundleContext.installBundle(location);

    return bundle;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号