[ 
https://issues.apache.org/jira/browse/FELIX-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561436#action_12561436
 ] 

Richard S. Hall commented on FELIX-467:
---------------------------------------

For what its worth, Tom Watson says Equinox works like this:

-----

Here is what we do in Equinox.

1) First of all, we do not do anything tricky for 1.4 vs 1.5. We assume 
ClassLoader.getResources is final and always delegates to the boot class loader 
for every package.
2) For Bundle.getResources() we do not actually ask the 
ClassLoader.getResources. Instead we wire directly into the proper OSGi 
delegation model. This unfortunately means Bundle.getResources() and 
ClassLoader.getResources could potentially return different results depending 
on what was available from the boot class loader.

Lets ignore that little issue and assume we can override 
ClassLoader.getResources and do proper OSGi delegation. The process should look 
something like this:

1) Check to see if the resource is in the java/* namespace. If so *only* 
delegate to boot and return the Enumeration returned from boot.
2) Check to see if the resource is on the o.o.f.bootdelegation list. If so get 
the Enumeration from boot and pass the result to the next step.
3) Check to see if the resource is imported (using Import-Package). If so 
delegate to the exporter's local (and fragments) classpath and return the 
results in a compound Enumeration which includes the results from the previous 
step. If not imported then pass the incoming Enumeration to the next step.
4) Check to see if the resource is accessed from a required bundle (using 
Require-Bundle). If so delegate to each required bundle's local (and fragments) 
classpath which exports the requested resource package and compound the results 
with the incoming Enumeration. Pass the results to the next step.
5) Delegate to the local bundle's (and fragments) classpath. Compound the 
results with the incoming Enumeration and return the results.

----

This approach is slightly different than ours, but still can lead to a 
situation where packages that are boot delegated AND imported can be combined 
for resources. It is different than our proposal because it explicitly stops if 
the package is imported.

> R4SearchPolicyCore.findResources(String) do not aggregate the Enumeration 
> founds
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-467
>                 URL: https://issues.apache.org/jira/browse/FELIX-467
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 1.0.0
>            Reporter: Guillaume Sauthier
>         Attachments: FELIX-467-tests-bundles.zip, FELIX-467.patch
>
>
> This issue is linked to FELIX-466
> The R4SearchPolicyCore.findResources(String) method just exits early on a 
> first hit, and doesn't continue into imported packages.
> It should aggregate the different hits and return all matching resources.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to