且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

这些OSGi命令实际上是做什么的?

更新时间:2022-11-28 07:56:14

关于此的***文档是 OSGi核心规范 .下面的部分和页码是指该规范的4.3版(2011年4月).

The best documentation for this is the OSGi Core Specification. The section and page numbers below refer to Release 4.3 (April 2011) of the spec.

osgi:install表示从文件或流安装捆绑软件,它映射到API中的BundleContext.installBundle方法.请参阅第90页的4.4.3节.

osgi:install means install a bundle from a file or stream, and it maps to the BundleContext.installBundle method in the API. Refer to section 4.4.3 on page 90.

osgi:refresh执行刷新包"操作,该操作允许在安装或更新一组捆绑包后重新连接导出/导入.例如,可以将当前连接到软件包的特定出口商的捆绑软件重新连接到新安装的捆绑软件,该捆绑软件可以导出同一软件包.请参阅第7.6页,第148页.

osgi:refresh performs a "refresh packages" operation, which allows exports/imports to be rewired after installing or updating a set of bundles. For example, bundles that are currently wired to a particular exporter of a package may be rewired to a newly installed bundle that exports the same package. See section 7.6.1, page 148.

osgi:resolve与refresh类似,但它仅连接当前处于INSTALLED状态的线束. IE.它将重新布线属于已解决状态的线束中的现有电线.

osgi:resolve is similar to refresh, but it only wires up bundles that are currently in the INSTALLED state. I.e. it will not rewire existing wires belonging to bundles that are already in the RESOLVED sate.

osgi:restart停止并重新启动特定的捆绑软件.这不会导致捆绑软件实现被更新,它只是停止和启动.请参阅第91页的4.4.5和第95页的4.4.7.

osgi:restart stops and restarts a specific bundle. This does not cause the bundle implementation to be updated, it simply stops and starts. See section 4.4.5 page 91 and 4.4.7 page 95.

osgi:update请求更新单个捆绑包(即,从其原始位置重新加载).这可能涉及停止,重新解析和启动捆绑软件,具体取决于捆绑软件在更新前所处的状态.请参阅第95页的4.4.9节.

osgi:update requests for a single bundle to be updated (i.e. reloaded from its original location). This may involve stopping, re-resolving and starting the bundle, depending on what state it was in before the update. See section 4.4.9 page 95.

所有OSGi捆绑软件状态的状态图在第90页的4.4.2(图4.4)部分中.

The state diagram for all the OSGi bundle states is in section 4.4.2 (Figure 4.4) page 90.