Repository navigation
Conversation
Implements the proposed org.osgi.framework.hooks.delegation.DelegationHook (osgi/org.osgi.framework#77) to show feasibility in Felix, analogous to eclipse-equinox/equinox#1395. - Add the DelegationHook API and export it from the framework and main bundles - Consult hooks as the last step of the search order for classes, resources and resource enumerations; skip java.* and imported, required or exported packages - Track classes provided by another bundle as a non-wire dependency so the asking bundle is part of the provider's refresh closure - Report throwing hooks as FrameworkEvent.ERROR and blacklist them Prototype only: no permission checks on registration and limited tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
laeubi
marked this pull request as draft
November 4, 2026 15:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prototype: support the OSGi DelegationHook
Implements the proposed
org.osgi.framework.hooks.delegation.DelegationHookin the Felix framework.Spec proposal: osgi/org.osgi.framework#77, background osgi/osgi#970.
Equinox prototype: eclipse-equinox/equinox#1395.
Changes
org.osgi.framework.hooks.delegationAPI and export it from the framework and main bundles.DelegationHookSupportcalls the hooks in ranking order.A hook that throws is reported as
FrameworkEvent.ERRORand not called again.BundleWiringImplconsults the hooks as the last step of the search order, after dynamic imports.This covers classes, single resources and resource enumerations.
Hooks are skipped for
java.*and for imported, required or exported packages.BundleRevisionDependenciestracks classes taken from another bundle as a non-wire dependency, so the asking bundle is part of the provider's refresh closure.Status
Prototype to show feasibility and surface spec questions, not a complete implementation.
DelegationHookTestcovers class lookup with the dependency closure, thejava.*skip, resource handling and a throwing hook.No permission checks on registration yet, and the skip for imported, required and exported packages is not tested.
Findings for the spec discussion
This relates to the open point in the spec PR about a plain dependency versus a wire.
No global framework lock is held there, but the loader's own class-loading lock stays held.