[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Adaptor API BundleClassLoader has been changed to an interface


If you want to use a URLClassLoader you should probably use the BundleFile API to extract the jars to the file system like the DefaultClassLoader and just construct URLs to these extracted jars.   Other things that would need to be considered is loading classes from a directory within jars (RFC 70 proposes for directories within jars to be used as a Bundle-ClassPath).  I'm not sure how this would be done with URLClassLoaders.  Maybe something like jar:file:/bundles/mybundle.jar!/classpathdir/ would work as a URL.  The URLClassLoader would also need to consider OSGi security when defining classes and constructing resource URLs.

Thomas Watson
Pervasive Development
Phone: 512-838-4533 Tie: 678-4533
tjwatson@xxxxxxxxxx



BJ Hargrave/Austin/IBM@IBMUS
Sent by: equinox-dev-admin@xxxxxxxxxxx

03/19/2004 08:07 PM
Please respond to equinox-dev

       
        To:        equinox-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [equinox-dev] Adaptor API BundleClassLoader has been changed to an interface




In general, No, But since URLClassLoader takes an array of URLs, you may be able to construct a URLClassLoader for a Bundle-Classpath of .,nested.jar with an array like so:


file:/dir/bundle.jar

jar:file:/dir/bundle.jar!/nested.jar


I would have to image the performance of this would be rather suboptimal!

BJ Hargrave

Senior Software Engineer, IBM, Austin, TX
OSGi Fellow and CTO of the
OSGi Alliance
hargrave@xxxxxxxxxx  904/5D-003 T/L 678-9938
Office: +1 512 838 9938 Mobile: +1 512 785 7386
[
vcard]

Pascal Rapicault <Pascal_Rapicault@xxxxxxxxxx>
Sent by: equinox-dev-admin@xxxxxxxxxxx

2004-03-19 05:39 PM

Please respond to
equinox-dev

To
equinox-dev@xxxxxxxxxxx
cc
Subject
Re: [equinox-dev] Adaptor API BundleClassLoader has been changed to an interface








Do we know if URLClassloader support nested jars?


PaScaL

Thomas Watson <tjwatson@xxxxxxxxxx>
Sent by: equinox-dev-admin@xxxxxxxxxxx

03/19/2004 12:02 PM

Please respond to
equinox-dev


To
equinox-dev@xxxxxxxxxxx
cc
Subject
[equinox-dev] Adaptor API BundleClassLoader has been changed to an interface










In the Adaptor API the BundleClassLoader used to be an abstract class that extended ClassLoader.  This limited the freedom of FrameworkAdaptors to use a subclass of ClassLoader to implement a BundleClassLoader.


The BundleClassLoader has been changed to an interface to allow more freedom in FrameworkAdaptors.  This should not effect developers that have implemented their own version of a BundleClassLoader that extends either the DefaultClassLoader or the EclipseClassLoader.  It will effect developers that may have implemented a ClassLoader that directly extends the old BundleClassLoader class.  A new class org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader has been added that extends ClassLoader and implements BundleClassLoader.  Extending the new AbstractClassLoader should be the same as extending the old BundleClassLoader class.


Let me know if you have any questions or problems.


Thansk.


Thomas Watson