The resolution rule for preferred candidate ordering is, unfortunately, a fluid rule since bundles can be resolved dynamically and in different orders from one run to the next.
 
For the first resolution of a set of bundles your assertion is correct.  The system bundle will always be the first bundle to enter the resolved state.  So any exports from the system bundle will be preferred for that resolution.  But now consider a new set of bundles is installed after the first resolution.  If the first resolution contained another bundle that exported the same package name as the system bundle now we are in a state where two bundles are resolved that export the same package.  This was not true for the first resolution.  Now if that bundle exports the package at a higher version than the system bundle its package version will be preferred for the second resolution.
 
For restarting from a persistent state.  That depends on the framework's persistent implementation.  The specification does not require that a framework persist the resolution wiring on shutdown.  It is acceptable for the framework to start from an unresolved state when launching from a cached set of installed bundles and then re-resolve the bundles as it is launching again.  For example, the Felix framework does not persist the resolution wires and re-resolved all installed bundles on restart while the Equinox framework does persist the resolution wiring and will reuse the wiring state on a restart.
 
HTH

Tom
 
 
 
----- Original message -----
From: Eran Twili via osgi-dev <osgi-dev@mail.osgi.org>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
Subject: [osgi-dev] Wiring rules
Date: Wed, May 9, 2018 9:01 AM
 

Hi,

 

I have some questions regarding wiring rules.

I know that spec says:

“The following list defines the preferences, if multiple choices are possible, in order of decreasing priority:

        A resolved exporter must be preferred over an unresolved exporter.

•     An exporter with a higher version is preferred over an exporter with a lower version.

        An exporter with a lower bundle ID is preferred over a bundle with a higher ID.”

 

But I need clarification on some nuances:

1.       In case same package is exported by system bundle with version 1, and regular bundle with version 2, and the importers aren’t specifying a version.

Is it true to say that although regular bundles’ export version is higher, actually the system bundle export will be chosen (since it‘s always resolved first)?

Generally this means that system packages will always be preferred, even though there exist a bundle that exports the same package with higher version?

2.       Is the later true also after restarting the FW, going up from persistence area?

Generally, assuming we never make changes to bundles state after first activation, does wiring can change after stopping the FW and going up again from persistence area?

 

Regards,

Eran

 


Confidentiality: This communication and any attachments are intended for the above-named persons only and may be confidential and/or legally privileged. Any opinions expressed in this communication are not necessarily those of NICE Actimize. If this communication has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender by e-mail immediately. 
Monitoring: NICE Actimize may monitor incoming and outgoing e-mails.
Viruses: Although we have taken steps toward ensuring that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.

 

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to