views:

117

answers:

3

I need to wait to start a bundle during the execution of another bundle, is this possible?

+1  A: 

You can do this in different ways. First, you might have a look at the start method of the Bundle interface class. With it, you can start a particular bundle. You also might have a look at Declarative Services or the Start Level Specification.

As a start you should read section 4.4.5 (Starting Bundles) of the OSGi core spec (available at www.osgi.org for free).

akr
A: 

If you mean: Starting up order of bundles.

As when starting an OSGi application, how can I make sure that lower level services provided by other bundles, are available for higher level services (/ for other bundles). Then you should read into Dynamic Services.

There are a few ways to solve this issue (as it has changed in the different version of OSGi). In case you are new to OSGi and Dynamic Service, the most logical solution is probably Declarative Services, but at least you should also read about Service Activator Toolkit, as it also has it own advantages & disadvantages.

There is a nice online Chapter 6, Dynamic Services, which exactly describes this issue and what solutions there are to solve it (at least 3 solutions are described).

In general I can recommend the book OSGi and Equinox, for anyone wanting to learn about / apply OSGi (Equinox).

Verhagen
A: 

Have you tried BundleContext.install() (BundleContext is passed in the activator start and stop methods)

George Boulos