ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Jython-users
Jython-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved