Closed bjhargrave closed 4 years ago
Comment author: @tjwatson
For OSGi Connect RFC 243 new static methods were added to FrameworkUtil to add/remove Helper implementations:
org.osgi.framework.FrameworkUtil.addHelper(Helper) org.osgi.framework.FrameworkUtil.removeHelper(Helper)
And a new type org.osgi.framework.FrameworkUtil.Helper was added.
This approach has several concerns. It allows connect implementations to add their helpers before launching the framework but it also allows normal bundles to try to add their own helpers to static set of helpers. This should not be allowed for many reasons, such as, concerns with pinning class loaders when a bundle is uninstalled and allowing normal bundles to influence the implementation of the FrameworkUtil dynamically.
We should move the Helper type to the new org.osgi.framework.connect package as something like org.osgi.framework.connect.FrameworkUtilHelper and instead have the FrameworkUtil only use the ServiceLoader to look up a static set of Helper implementations available on the class/module path available to the class loader loading the FrameworkUtil class. Moving the type to the connect package makes it obvious this is not a type to be used by normal bundles.
Comment author: @bjhargrave
+1
Comment author: @rotty3000
+1
Comment author: @tjwatson
I did do this update with:
Leaving open to make sure it is agreed to on an EG call that discusses RFC 243
Comment author: @bjhargrave
CPEG call: Fixed.
Original bug ID: BZ#3131 From: @tjwatson Reported version: R8