Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Multiple hosts for a single Fragment
Multiple hosts for a single Fragment [message #779645] Mon, 16 January 2012 08:41 Go to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Hi,

while implementing a dynamic Fragment, I stumbled over the fact that a
fragment may have multiple hosts. It seems to be possible at internal
API and one can enter multiple hosts in the Fragment manifest. However,
at runtime it does not seem to work.

Any comment on this one? I'm more or less asking out of curiosity but
could imaging that one can do nice things with that feature...

Thanks in advance
Jan
Re: Multiple hosts for a single Fragment [message #779758 is a reply to message #779645] Mon, 16 January 2012 13:46 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
The OSGi specification only allows a single element in the Fragment-Host manifest. A fragment may get attached to multiple versions of the same host (hosts that have the same bundle-symbolic-name) assuming you leave the version range open enough and you have multiple versions of the same host installed.

Here is the syntax of the Fragment-Host header from the OSGi specification:

Fragment-Host ::=bundle-description
bundle-description ::=symbolic-name (';' parameter ) *

Notice that only a single bundle-description is allowed.

HTH

Tom
Re: Multiple hosts for a single Fragment [message #779801 is a reply to message #779758] Mon, 16 January 2012 15:26 Go to previous messageGo to next message
Jan Mauersberger is currently offline Jan MauersbergerFriend
Messages: 120
Registered: July 2009
Senior Member
Tom,

thanks for the detailed info. Things are clear now.

Jan

> The OSGi specification only allows a single element in the Fragment-Host
> manifest. A fragment may get attached to multiple versions of the same
> host (hosts that have the same bundle-symbolic-name) assuming you leave
> the version range open enough and you have multiple versions of the same
> host installed.
>
> Here is the syntax of the Fragment-Host header from the OSGi specification:
>
> Fragment-Host ::=bundle-description bundle-description ::=symbolic-name
> (';' parameter ) *
> Notice that only a single bundle-description is allowed.
>
> HTH
>
> Tom
Re: Multiple hosts for a single Fragment [message #1052915 is a reply to message #779758] Wed, 01 May 2013 10:39 Go to previous messageGo to next message
Andreas Rytina is currently offline Andreas RytinaFriend
Messages: 4
Registered: July 2009
Junior Member
It is not possible to attach a fragment to multiple hosts with the same symbolic name, even if the API and the fragment grammar seems to support this. Look here www.google.de/#output=search&sclient=psy-ab&q=site:https%3A%2F%2Fmail.osgi.org+%22multiple+hosts%22&oq=site:https%3A%2F%2Fmail.osgi.org+%22multiple+hosts%22
I also stumbled over this issue in my current customer project. It seems that if more versions of the host are available in the target then equinox will attach the fragment to the newest host version. Maybe some Equinox expert can confirm this?

Cheers,
Andreas Rytina
Re: Multiple hosts for a single Fragment [message #1052923 is a reply to message #1052915] Wed, 01 May 2013 12:40 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
The specification did go back and forth on this for OSGi R4. For the OSGi R4 specification it was finally decided to only allow a fragment to attach to a single host at a time. Then later (I cannot remember the exact OSGi spec version) it was decided to loosen this and allow a fragment to attach to multiple hosts.

In Equinox in order to enable a fragment to attach to multiple hosts you must enable the configuration option osgi.support.multipleHosts=true

PDE uses the same resolver as equinox. The use the default setting which would only allow a fragment to attach to a single host. This is a limitation of the PDE tooling that I don't think can be changed easily since PDE uses the resolution result to determine the class path of the fragment. If a fragment got attached to multiple hosts then a single host would need to be picked to place on the fragment's build time class path.

Tom

Re: Multiple hosts for a single Fragment [message #1052926 is a reply to message #1052923] Wed, 01 May 2013 12:48 Go to previous message
Andreas Rytina is currently offline Andreas RytinaFriend
Messages: 4
Registered: July 2009
Junior Member
Thank you Tom for clarification!
Previous Topic:Issue with loading bundles from project directories with embedded equinox.
Next Topic:Read a file residing in other plugin
Goto Forum:
  


Current Time: Fri Apr 19 03:05:04 GMT 2024

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

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

Back to the top