Community
Participate
Working Groups
If a new bundle is being installed for which there already is an installed bundle with the same BSN/Version then the following will be done when org.osgi.framework.bsnversion=managed In the bsn/version check we ask the find hooks, can the installing bundle context see any of the collection of already installed bundles with the same bsn/version as the about to be installed bundle. In this case the Collection<Bundle> will contain all the bundles with the requested BSN/version of the about to be installed bundle. If at the end of the bundle find hooks call the Collection<Bundle> is empty then the install succeeds; otherwise the insetall fails with a REJECTED_BY_HOOK BundleException. Note that the find hooks are only consulted if "managed" is used.
Created attachment 197823 [details] patch and tests Unfortunately it did not turn out to be feasible to use the bundle FindHook to accomplish this. I needed to introduce a new bundle CollisionHook. This patch does that in the existing org.osgi.framework.hooks.bundle package. I am proposing this back to OSGi in RFC 174. Note that this is provisional and very early work. I am simply attaching the patch here so I don't lose the prototype work I have done so far.
RFC 174 is moving forward. I will revisit this patch and plan to get it ready for M2.
I merged an updated patch to master with: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=fe711b408d3523f680c4e356221369581057e6ce