Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348967

Summary: [R4.4] Handle new option "managed" for org.osgi.framework.bsnversion configuration property
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: glyn.normington, hargrave, jwross
Version: 3.7   
Target Milestone: Juno M2   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 349944, 354191    
Attachments:
Description Flags
patch and tests none

Description Thomas Watson CLA 2011-06-09 17:13:37 EDT
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.
Comment 1 Thomas Watson CLA 2011-06-10 17:12:49 EDT
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.
Comment 2 Thomas Watson CLA 2011-08-04 14:29:07 EDT
RFC 174 is moving forward.  I will revisit this patch and plan to get it ready for M2.
Comment 3 Thomas Watson CLA 2011-08-08 16:08:36 EDT
I merged an updated patch to master with:

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=fe711b408d3523f680c4e356221369581057e6ce