Message85
I extended java.lang.ClassLoader with my own implementation that
locally loads new copies of everything except system classes. This
is so that I could fire up a JVM once and re-run my code over and
over again, grabbing the new versions of my code each time.
You can trust me that (a) my ClassLoader works; and (b) I have
tried this in pure Java code, and it works fine. If you can
immediately see how this is taking place, then we're ok; if not,
then pls email me and I will send you my code.
(I tried going through the JPython source code to pinpoint the
portions responsible, but I couldn't find them.)
I have reproduced this on Solaris 2.6 with Sun JDK 1.2, which
tells me that this is probably not platform dependent.
Here is a JPython session illustrating what I mean --
==========
akudo: [src/corba] > jpython
JPython 1.1beta2 on java1.2
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> import edu.umn.genomics.util
>>> cl = edu.umn.genomics.util.ClasspathClassLoader()
>>> cl
edu.umn.genomics.util.ClasspathClassLoader@984dff91
>>> cl.loadClass('edu.umn.genomics.util.test.SimpleTestClass')
<jclass edu.umn.genomics.util.test.SimpleTestClass at -2094399598>
>>> del(cl)
>>> cl = edu.umn.genomics.util.ClasspathClassLoader()
>>> cl
edu.umn.genomics.util.ClasspathClassLoader@b9a5ff91
>>> cl.loadClass('edu.umn.genomics.util.test.SimpleTestClass')
<jclass edu.umn.genomics.util.test.SimpleTestClass at -2094399598>
==========
As you can see, although I had a different instance of my class
ClaspathClassLoader, the resulting jclass object is identical to
the one I first obtained, leading me to believe that they are
cached in some way.
Assuming this to be a "feature", I think it limits the use of
Java Reflection in JPython; it should at least be a configurable
option.
|
|
Date |
User |
Action |
Args |
2008-02-20 17:16:40 | admin | link | issue222820 messages |
2008-02-20 17:16:40 | admin | create | |
|