cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [help needed] Patching the Servlet API on classloading
Date Tue, 18 Jun 2002 21:09:20 GMT
David Haraburda wrote:

>Sylvain Wallez wrote:
>>. . .
>>Another related item : while updating the ParanoidClassloader to make it
>>really paranoid, I encountered an inconsistency in java.lang.ClassLoader
>>class : getResource() can be overriden, but getResources() is declared
>>final, meaning there is no way to change the order in which e.g.
>>indentical service definitions in META-INF/services are enumerated.
>>Although this shouldn't cause a problem with JAXP (at least the Apache
>>implementation) which uses getResource() (no enumeration), we should be
>>aware that this is a potential pitfall.
>This isn't an inconsistency, it's intentional -- getResources() is a final method that
calls findResources, a protected method on the current instance of the ClassLoader.  ClassLoader
implementations should override findResources(). The purpose of getResources() is to get a
set of resources from all the
>classloaders in the classloader heirarchy.

I don't agree with you : findResources() is the method that a given 
ClassLoader can redefine to enumerate *its own resources*. 
getResources() aggreates the enumerations of all resources found in the 
classloader hierarchy. But it does this using the "standard" order which 
is system classloader resources first and custom classloader resources 
last. So you can't change the order of the enumeration to give a higher 
priority to custom classloader resources by enumerating them first.


Sylvain Wallez
 Anyware Technologies                  Apache Cocoon 

To unsubscribe, e-mail:
For additional commands, email:

View raw message