Capabilities and startup order [message #1727299] |
Mon, 21 March 2016 21:07 |
Dirk Fauth Messages: 2903 Registered: July 2012 |
Senior Member |
|
|
Hi,
I played around with declarative services a bit. With Neon the DS bundle specifies the Provide-Capability header like this:
Provide-Capability: osgi.extender;osgi.extender="osgi.component";
version:Version="1.2";uses:="org.osgi.service.component"
In my bundle I add the Require-Capability header like this:
Require-Capability: osgi.extender;
filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
I thought that adding the capability headers would have impact on the startup order of the bundles, similar to dependencies via Import-Package. But regardless what I configure for my declarative service or the bundle that contains it, the bundle org.eclipse.equinox.ds stays in RESOLVED state and my bundle in either RESOLVED or STARTING.
To make it work, it is necessary to specify the following in the config.ini
osgi.bundles=plugins/org.eclipse.equinox.common@2:start,\
plugins/org.eclipse.equinox.ds@2:start,\
plugins/org.eclipse.update.configurator@3:start
So my question is, do I understand the capability headers and the impact on the start order correctly or is this a misunderstanding on my side? And if I understand it correctly, do I configure something wrong, or is there an issue in the Equinox framework?
Would be great if someone could help me in understanding capabilities and startup order configuration better.
Greez,
Dirk
|
|
|
|
Re: Capabilities and startup order [message #1727360 is a reply to message #1727315] |
Tue, 22 March 2016 12:34 |
Dirk Fauth Messages: 2903 Registered: July 2012 |
Senior Member |
|
|
Erdal Karaca wrote on Tue, 22 March 2016 07:43The capabilities API is a separate topic within the OSGi specs.
That is not an answer to my question.
In the meanwhile I found out that capabilities are used to resolve whether bundles can be activated, not whether they need to be started. So it looks like it is sufficient to specify the auto-start of the bundles, not necessarily specify the start level.
osgi.bundles=plugins/org.eclipse.equinox.common@start,\
plugins/org.eclipse.osgi.services@start,\
plugins/org.eclipse.equinox.util@start,\
plugins/org.eclipse.equinox.ds@start,\
plugins/org.eclipse.equinox.event@start,\
plugins/org.eclipse.update.configurator@start
Although I also read some posts that said specifying the start level for framework bundles might be ok, but you should definitely not rely on start levels for application bundles.
Keeping it that way should be fine.
|
|
|
Powered by
FUDForum. Page generated in 0.04611 seconds