AnonymousClassLoader in JRuby
forax at univ-mlv.fr
Sun Apr 27 03:34:19 PDT 2008
Charles Oliver Nutter a écrit :
> Rémi Forax wrote:
>> In my opinion, there is one AnonymousClassloader by host class to
>> share security check.
> I'm not sure I see how to use a single java.dyn.AnonymousClassLoader
> to load multiple classes, since it seems to want the class bytes on
> construction. Looking at source now.
First, the AnonymousClassLoader in the hg repository has several
See the thread:
*Be it as it may*, the AnonymousClassLoader only takes an hostClass at
And you can use setClassFile() and then loadClass() to load an anonymous
You perhaps browse the source code too kickly,
the constructors are definined in the middle of the file not in the
it's trouble me too the first time i've read that code.
>> Else, why do you use reflection in org.jruby.util.AnonymousClassLoader ?
> The reflection stuff is just to isolate pre-DVM JDKs from
> java.dyn.AnonymousClasLoader. It would probably be replaced with a
> pluggable mechanism of some kind. So it's essentially the same as what
> you have, but backward compatible.
Ok, you want to be able to compile the sources without the package java.dyn.
I've perhaps found why there is no difference in your test.
I've re-read the code of your ruby Classoader and someting is weird,
the last instruction of the static block should be
ANONYMOUS_SUPPORTED = true;
ANONYMOUS_SUPPORTED = false;
More information about the mlvm-dev