启动放置在 Karaf 的部署文件夹中的包 [英] Startup for bundles placed in the deploy folder of Karaf

查看:26
本文介绍了启动放置在 Karaf 的部署文件夹中的包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个包——包-A 导出 bnd.a.* 包,包-B 导入 bnd.a.*;我将这些包保存在部署文件夹中;它有效,但有时bundle-B先于bundle-A出现并失败!有没有办法为部署文件夹中保存的包设置启动顺序?

I have two bundles - bundle-A exports bnd.a.* packages and bundle-B imports bnd.a.*; I keep these bundles in the deploy folder; it works but there are times when bundle-B comes first before bundle-A and fails! Is there a way to set the start up order for bundles kept in the deploy folder?

请注意,我们使用功能的启动级别使其正常工作,但不在部署文件夹中.

Please note that we got it working using feature's start level but not right in the deploy folder.

推荐答案

否,因为 deploy 文件夹只是在开发期间部署包的另一种方式.对于生产,最好使用特征描述符.在开发时使用 Karaf 的另一种方法,使用来自 karaf shell 的 bundle:watch 命令,它会更新一个包,以防它被重新编译.

No, as the deploy folder is just another way of deploying bundles during development time. For Production it's always best to use feature descriptors. Another way of using Karaf in development time, use the bundle:watch command from the karaf shell it'll update a bundle in case it did get re-compiled.

另一个提示,你不应该依赖开始级别,而是尝试确保你的第二个包导入一个只有在第一个包可用时才可用的服务.这将确保您的应用程序更加安全.

Another hint, you should never rely on the start level, instead try to make sure your second bundle imports a service only available when the first bundle is available. This will make sure your application is much more failsafe.

这篇关于启动放置在 Karaf 的部署文件夹中的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆