Skip to main content



      Home
Home » Eclipse Projects » Equinox » Capabilities and startup order
Capabilities and startup order [message #1727299] Mon, 21 March 2016 17:07 Go to next message
Eclipse UserFriend
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 #1727315 is a reply to message #1727299] Tue, 22 March 2016 02:43 Go to previous messageGo to next message
Eclipse UserFriend
The capabilities API is a separate topic within the OSGi specs.
Re: Capabilities and startup order [message #1727360 is a reply to message #1727315] Tue, 22 March 2016 08:34 Go to previous message
Eclipse UserFriend
Erdal Karaca wrote on Tue, 22 March 2016 07:43
The 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.
Previous Topic:Why can a plug-in project Execution Environment not change from JavaSE-1.8 to OSGi/Minimum-1.2?
Next Topic:Eclipsecon06 OSGi tutorials
Goto Forum:
  


Current Time: Mon Apr 14 19:07:15 EDT 2025

Powered by FUDForum. Page generated in 0.04144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top