Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[corona-dev] Automatic / declarative bundles start.

We have some problems with starting required plugins that have indirect relationships. Currently we have the starting sequence hardcoded, which is not a desired solution. We would like to do it more decleratively.

I did a plugin which listens to boundle events and if a new bundle starts, it checks its MANIFEST.MF for X-Require-Started header, which contains the plugins to start. There is one disadvantage of this approach - you need to start this bundle before other boundles, so it requires change in config.ini. But then everything magicly runs.

The plugin is commited to Eclipse CVS in incubator. Plugin name is org.eclipse.corona.bundlestarter. There are 3 bundles which use this approach, just to test it - org.eclipse.corona.tests.bundlestarter.b[1-3]. There is also an OSGi launch configuration "Bundle Starter". To check how it works, run the "Bundle Starter" launch. In console type:
1. ss
2. start org.eclipse.corona.tests.bundlestarter.b1
3. ss

You will see that plugins b1-b3 are started, eventhough there are no dependenticies between them. The real start order will be b3,b2,b1. If you would start b2, then b2 and b3 would be active, and b1 kept as is.

Note: for some reason the lounch sometimes stars all bundles, eventhough the b1-b3 are marked to be not started. I found that it helps if you start the OSGi configuration from run window rather than recently started configurations.

What do you think about this? Should we switch to this approach?
I would then polish it and add also the reversed dependency - "start me, when some other bundle starts" rather than current "start some bundles when I start".

Marcin

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

Back to the top