如何在运行时启动 OSGI 包?

发布于 2024-08-24 13:29:15 字数 32 浏览 9 评论 0原文

我需要在另一个包执行期间等待启动一个包,这可能吗?

I need to wait to start a bundle during the execution of another bundle, is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

表情可笑 2024-08-31 13:29:15

如果您的意思是:启动捆绑包的顺序。

当启动 OSGi 应用程序时,我如何确保其他捆绑包提供的较低级别的服务可用于较高级别的服务(/用于其他捆绑包)。那么您应该阅读动态服务。

有几种方法可以解决这个问题(因为它在不同版本的 OSGi 中有所改变)。如果您不熟悉 OSGi 和动态服务,最合乎逻辑的解决方案可能是声明式服务,但至少您还应该阅读服务激活器工具包 em>,因为它也有自己的优势&缺点。

网上有一个很好的 第 6 章,动态服务,这正是描述这个问题以及解决它的解决方案(至少描述了 3 个解决方案)。

总的来说,我可以向任何想要了解/应用 OSGi (Equinox) 的人推荐这本书 OSGi 和 Equinox

If you mean: Starting up order of bundles.

As when starting an OSGi application, how can I make sure that lower level services provided by other bundles, are available for higher level services (/ for other bundles). Then you should read into Dynamic Services.

There are a few ways to solve this issue (as it has changed in the different version of OSGi). In case you are new to OSGi and Dynamic Service, the most logical solution is probably Declarative Services, but at least you should also read about Service Activator Toolkit, as it also has it own advantages & disadvantages.

There is a nice online Chapter 6, Dynamic Services, which exactly describes this issue and what solutions there are to solve it (at least 3 solutions are described).

In general I can recommend the book OSGi and Equinox, for anyone wanting to learn about / apply OSGi (Equinox).

坐在坟头思考人生 2024-08-31 13:29:15

您可以通过不同的方式来做到这一点。首先,您可能会看一下 Bundle 接口类的 start 方法。有了它,您可以启动特定的捆绑包。您还可以查看声明性服务或启动级别规范。

首先,您应该阅读 OSGi 核心规范的第 4.4.5 节(启动包)(可在 www.osgi.org< /a> 免费)。

You can do this in different ways. First, you might have a look at the start method of the Bundle interface class. With it, you can start a particular bundle. You also might have a look at Declarative Services or the Start Level Specification.

As a start you should read section 4.4.5 (Starting Bundles) of the OSGi core spec (available at www.osgi.org for free).

绿光 2024-08-31 13:29:15

您尝试过BundleContext.install()吗? (BundleContext 在激活器启动和停止方法中传递)

Have you tried BundleContext.install()? (BundleContext is passed in the activator start and stop methods)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文