This code is based on the Code of version 2.06.
I modified JavaBridgeClassLoader (only very slightly),
modified JavaBridgeClassLoader (significantly, it's now
derived from DynamicClassLoader) and added 2 new
classes: DynamicClassLoader (which adds dynamic
class loading/unloading) and BridgeThread (which adds
a simple Thread pool implementation).
A thread pool seemed neccessary, since it is
1.) Generally a good idea
2.) Every Thread gets it's own Classloader, and
Classloader instantiation is much more expensive than
calling DynamicClassLoader.clear() and re-using it.
To disable the ThreadPool, simply set
BridgeThread.poolSize to 0
The DynamicClassLoader uses advanced caching and
lazy evaluation methods to keep it's resource usage as
low as possible, while still allowing modification-tracking
of Jar-Files and Class Re-Loading.
- Testing - I have made a few tests and it worked well,
but who knows.
- This implementation adds the System Jar files by
default to the delayed list of Classloaders. I don't
consider that a beautiful solution, but it was quick.
Log in to post a comment.