Re: [Jython-users] Example of Java class reloading
by Samuele Pedroni other posts by this author
Feb 27 2002 5:15PM messages near this date
[Jython-users] Example of Java class reloading
|
[Jython-users] partial imports
Example of Java class reloadingHi
From: Gustav Bostrom
> Hi!
> I'm struggling to get the Java-class reloading to work.
> I'm not very succesful.
> Does anyone have a good example to share?
> I tried this, but it didn't work:
> import jreload
> classpath=["V:\\eonworx\\output\\contrib\\studio\\classes"]
> classesLoadSet=jreload.makeLoadSet("classes",classpath)
> print classesLoadSet
> from classes import Hello
> jreload.reload(classesLoadSet)
you don't need this jreload.reload call
> def rl():
> jreload.reload(classesLoadSet)
> def runHello():
> Hello().sayHello()
>
> When I run rl() the Hello-class is still not reloaded and runHello() still
produces the old result.
Assuming that you have changed the class before calling rl() <wink> , the code
seems correct.
The Jython Demo/jreload directory contains the artifacts to run the interactive
session example
in Doc/jreload.html documentation.
Up to bugs, the only important thing to remember is that the LoadSet path
should
be disjunct from classpath and sys.path otherwise reloading will not work
(Java limitation).
regards, Samuele Pedroni.
_______________________________________________
Jython-users mailing list
Jython-users@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-users
Thread:
Gustav Bostrom
Samuele Pedroni
|