felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Watson <tjwat...@us.ibm.com>
Subject Re: bundle.getResources behavior
Date Thu, 14 Dec 2006 13:55:30 GMT
Currently we do not do anything.  I am considering making a framework 
extension bundle fragment that adds a bundle classloader that can be used 
on J2SE 1.5.  The problem I have is that the core Equinox framework is 
compiled against the OSGi EE minimum 1.1 library.  I could add a bundle 
classloader implementation to the core framework that extends the existing 
bundle classloader and overrides the getResources method.  Then at runtime 
pick the correct implementation of the bundle classloader depending on the 
level of the EE.  But this would force me to compile the core framework 
against J2SE 1.5.  Something I'm not willing to do at this point.  For me 
it is probably better to stick this extra class (compiled against J2SE 
1.5) in a framework fragment, then runtime can load that version of the 
bundle classloader if it is installed and resolved.  I would make that 
fragment bundle have a required EE of J2SE 1.5 so it could not be 
installed on an older VM.


"Richard S. Hall" <heavy@ungoverned.org> 
12/14/2006 07:35 AM
Please respond to


Re: bundle.getResources behavior

Thomas Watson wrote:
> This is probably because the ClassLoader.getResources method is final on 

> J2SE 1.4 and earlier.  In J2SE 1.5 they removed the 'final' from this 
> method.  This makes it impossible to implement a "correct" bundle 
> classloader on J2SE 1.4 and earlier WRT ClassLoader.getResources.  The 
> implementation of the final ClassLoader.getResources method always 
> the parent classloader first, there is no way for the OSGi Bundle class 
> loader to override this behavior.  We have the exact same situation in 
> Equinox.


Tom, so do you have some check in place to do the correct thing when 
running on 1.5 as opposed to < 1.5 ? If so, what approach do you use?

-> richard

> Tom
> "Chris Custine" <chris.custine@gmail.com> 
> 12/14/2006 12:37 AM
> Please respond to
> felix-dev@incubator.apache.org
> To
> felix-dev@incubator.apache.org
> cc
> Subject
> bundle.getResources behavior
> My understanding of the OSGi spec is that Bundle.getResources() should 
> only
> look in the System classpath if the package name is listed in the
> org.osgi.framework.bootdelegation property, is that correct?  I am 
> on a problem where Felix is returning a resource from a non-bundle jar
> (Felix is embedded) that is on the main application classpath.  Any 
> Thanks,
> Chris

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message