Start level and start order are two different concepts in OSGi. The start level is defined to be a state of execution in which the Framework exists. StartLevel values are defined as unsigned integers with 0 (zero) being the state where the Framework is not launched. Progressively higher integral values represent progressively higher start levels. e.g. 2 is a higher start level than 1. In Apache Karaf we use the scale from 0 to 100.
The start order of bundles in not guaranteed in OSGi (not part of the spec). Since bundles can come and go at runtime its best practice to write your applications to be aware of these conditions. Once approach you may take is to have your bundles export and import each other as dependencies - in this way the framework will not start your bundles until it's dependencies are available (for bundles A, B, and C, having B require A, and C require B should result in C not starting until A & B are available). Cheers, Jamie On Tue, Apr 16, 2013 at 11:53 AM, Martin Lichtin <[email protected]> wrote: > Hi > > can you clarify how start-order is accounted for when used as part of a > feature? > For example > > <feature version="1.0.0" name="ftr"> > <bundle>b1</bundle> > <bundle start-level="60">b2</bundle> > <bundle start-level="55">b3</bundle> > </feature> > > As far as I can see, the start-level value has no effect. > It is not taken into account during feature:install or feature:uninstall. > > I see that after Karaf (2.3.1) starting up, the framework start-level is > at 100. > The default start-level of the feature bundles, eg. b1 in above example, > is 80. > So then, when running "feature:install ftr", I would expect the start > order: b3,b2,b1 > For "feature:uninstall ftr", I would expect stop order: b1,b2,b3. > > Any clarifications appreciated! > > Martin > >
