激活所有捆绑包后,如何使捆绑包激活剂实例调用方法

发布于 2025-01-31 15:15:34 字数 75 浏览 2 评论 0原文

启动每个捆绑包后,我需要调用带有捆绑激活程序实例的方法。我有五捆。如何获得捆绑激活程序实例? 要求:仅调用Activator实例的方法。

I need to call a method with bundle activator instance after every bundle is started. I have five bundles. How do I get the bundle activator instance?
Requirement: Call a method only with the activator instance.

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

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

发布评论

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

评论(1

祁梦 2025-02-07 15:15:34

查看使用EventHandler(或者可能取决于您的用例)。 OSGI定义了EventHandler将收到的FrameWorkevent。您可以根据“开始”事件配置第二阶段以触发。

  • org.osgi.service.event.eventhandler
  • org.osgi.framework.frameworkevent

替代:org.osgi.util.tracker.bundletracker

Look into using EventHandler (or perhaps BundleTracker depending on your use case). OSGi defines a FrameworkEvent that an EventHandler will receive. You could configure your second stage to trigger based on the 'STARTED' event.

  • org.osgi.service.event.EventHandler
  • org.osgi.framework.FrameworkEvent

alternatively: org.osgi.util.tracker.BundleTracker

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