laeubi opened a new pull request, #591:
URL: https://github.com/apache/felix-dev/pull/591

   ## Prototype: support the OSGi DelegationHook
   
   Implements the proposed `org.osgi.framework.hooks.delegation.DelegationHook` 
in the Felix framework.
   Spec proposal: https://github.com/osgi/org.osgi.framework/pull/77, 
background osgi/osgi#970.
   Equinox prototype: https://github.com/eclipse-equinox/equinox/pull/1395.
   
   ### Changes
   
   - Add the `org.osgi.framework.hooks.delegation` API and export it from the 
framework and main bundles.
   - `DelegationHookSupport` calls the hooks in ranking order.
     A hook that throws is reported as `FrameworkEvent.ERROR` and not called 
again.
   - `BundleWiringImpl` consults 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.
   - `BundleRevisionDependencies` tracks 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.
   `DelegationHookTest` covers class lookup with the dependency closure, the 
`java.*` 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
   
   - Felix tracks the dependency as a plain refresh dependency, not a wire.
     This relates to the open point in the spec PR about a plain dependency 
versus a wire.
   - The dependency affects refresh only and does not stop a provider from 
being uninstalled.
   - Felix's re-entrancy guard is keyed by name only, so it also blocks a class 
and a resource lookup that share a name.
   - The hook runs inside the class-loading call.
     No global framework lock is held there, but the loader's own class-loading 
lock stays held.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to