classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SystemClassLoader


From: Robert Lougher
Subject: SystemClassLoader
Date: Tue, 2 Dec 2003 07:56:45 +0000

Hi,

I've been a long time lurker on this mailing list, but I've got a question I hope the classpath developers can answer...

I'm the developer of yet another open-source Java VM (http://jamvm.sourceforge.net). I'm about to release version 1.1.1 which has been updated to Classpath-0.07 (basically VMThread/Thread).

One of the things I've finally got round to changing is using a system class loader to load application classes (up to now loaded via the bootstrap - I've been more interested in getting the Reflection API fully implemented).

Looking at the code, the "default" system class loader (in gnu.java.lang...) simply delegates to the bootstrap loader - it doesn't implement findClass. Obviously, it's not difficult to write my own to parse and search the classpath (zip, jar, file...). However, is there any reason why I can't simply sub-class URLClassLoader, and construct a list of URLs? I've got a simple SystemClassLoader based on URLClassLoader and it seems to work OK.

Performance-wise, the VM keeps it's own list of loaded-classes so a class-loader isn't continually asked for the same class (although this will work). Note, I'm interested in doing this so that JamVM can read from jar and zip files - implementing zip in the VM duplicates functionality and I'm trying to keep JamVM small (approx 80K on Intel, 100K on PowerPC stripped).

Thanks,

Rob.

P.S. Thank you for your work on Classpath - I've been using it since 0.04 and it's come a long way. With Classpath-0.06 I was able to run Jetty-4.2.14 (web server and servlet container) on a 50MHz PowerPC with only a couple of modifications, which have been fixed in 0.07...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]