What do these OSGi commands really do?

后端 未结 2 1771
一生所求
一生所求 2021-02-06 03:15

Using Felix / Equinox, what do the following do under the hood?

osgi:install
osgi:refresh
osgi:resolve
osgi:restart
osgi:update

Is there a stat

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 03:52

    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 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 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 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 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 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.

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

提交回复
热议问题