Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Capabilities and startup order
Capabilities and startup order [message #1727299] Mon, 21 March 2016 21:07 Go to next message
Dirk Fauth is currently offline Dirk FauthFriend
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 #1727315 is a reply to message #1727299] Tue, 22 March 2016 06:43 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
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 12:34 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2903
Registered: July 2012
Senior Member
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: Sun Oct 13 08:43:11 GMT 2024

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

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

Back to the top