Hi Raul,

why don't you use a feature, in the feature you set the start-level of your bundles ?

Regards
JB

On 12/16/2011 02:10 PM, Raul Kripalani wrote:
Hi,

In many occasions you will have set custom start levels for your
organisation's bundles to better honour the internal dependencies between
them.

The bundle's start level will be preserved across bundle updates, but as
your system evolves, the version numbers of your bundles will increment and
"osgi:update" won't not applicable anymore to update to the next version.
You will need to perform osgi:install and osgi:uninstall.

I think having a mechanism to "pin" a specific start level to bundles such
that it is preserved across version updates would be great.

Two ways of achieving this sticky start level behaviour spring to mind:

1. Create a custom manifest header to set the level, such as...
Karaf-Bundle-Start-Level: 70. The down side is that portability decreases
and not only between OSGi implementations, but also between deployment
scenarios. After all, organisation A won't be using the same start level
policy/scale as organisation B.

2. Create a management agent that listens to bundle installation events and
leverages the Start Level OSGi service, along with a configuration file
that maps Bundle Symbolic Names to start levels, to set the remembered
start level back on the bundle. The config file would have the format:
bundleSymbolicName=startLevel. Check out:
http://www.osgi.org/javadoc/r4v43/org/osgi/framework/startlevel/BundleStartLevel.html(post
OSGi 4.3),
http://www.osgi.org/javadoc/r4v43/org/osgi/service/startlevel/StartLevel.html(pre
OSGi 4.3).

What do you think?

Regards,

*Raúl Kripalani*
FuseSource Corp.
fusesource.com<http://www.fusesource.com/>  | twitter: @raulvk, @fusenews


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to