Using Felix / Equinox, what do the following do under the hood?
osgi:install
osgi:refresh
osgi:resolve
osgi:restart
osgi:update
Is there a state-machine diagram or more concise documentation somewhere?
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.
For the details of what the Felix shell commands do, you might just look at their source code, at http://svn.apache.org/repos/asf/felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/ - most of them are short and simple.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With