I'm looking to compare Virgo with an existing Karaf installation and am looking for a bootstrap example. I found
AbstractOsgiFrameworkLaunchingTests.java which seems close, but it's setting up a lot that I'm not sure it needed.
In 3.0.x and earlier versions we used our own launcher that used OSGi's FrameworkFactory API. The bootstrapping code is more or less covered here.
In 3.5 we've been consuming the Equinox launcher that is bundled with Eclipse. Generally it executes similar logic but adds a few more useful configuration options listed here.
Basically to programmatically invoke the framework's start in 3.5 you can use the Main class in the Equinox Launcher - it should do everything for you. Just put Equinox in its classpath.
If you want to get a feeling of the internals browse the EclipseStarter class. Here's the launcher's and Equinox's git repo.
Borislav Kapukaranov wrote on Wed, 08 February 2012 03:25
Out of curiosity, what is your use case that requires bootstrapping knowledge?
We're embedding an OSGI runtime inside of an application that's not pure OSGI yet. The first steps are changing our service locator implementation from Spring to Blueprint, making our core components available to Bundles. We're also migrating all plugins to OSGI.
Eventually when the whole system is converted over and the uses of the service locator are gone, we'll not need to embed the framework, but that's a while away.
If you're still curious, it's the Pentaho BI Platform.