tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Tagunov <>
Subject [PROPOSAL] Use javac as an load-from-context-classloadr compiler (was: Classloader when Tomcat is embedded + save)
Date Sun, 14 Sep 2003 12:07:17 GMT
Hello Matthias and All!

>> Of course, it's good to remember that this code exists only because of
>> the lack of a good in memory compiler. This could change.

mecc> Class org.eclipse.jdt.internal.compiler.Compiler in combination with
mecc> provide a load-from-context-classloader compiler, independent of the
mecc> filesystem. The latter can be easily turned into an ant CompilerAdapter.

mecc> I've once briefly browsed the javac source, that one couldn't even easily
mecc> be adapted.

What if we:

Create a special classloader. Teach this classloader not to
delegate loading of to its parent classloader.

Load except for 
  File, FileInputStream, FileOutputStream
directly from rt.jar.

Load our own implementations of
  File, FileInputStream, FileOutputStream
to create own own "virtual" fs.

Load tools.jar with this classloader too.

This way we may fool javac and use it as an
in-process load-from-context-classloader compiler.

We may use for instance a ThreadLocal variable
to short-circuit our in-house reiplementations
of File* to the classloader and a sink accepting
compiled classes.

The only question I have: does sun licsense allow
us to legimately do this?


View raw message