[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-dev
Subject:    Re: [groovy-user] Re: GroovyClassLoader Question
From:       jastrachan () mac ! com
Date:       2004-06-25 7:01:38
Message-ID: 80D236C7-C675-11D8-992F-000A959D0312 () mac ! com
[Download RAW message or body]


On 25 Jun 2004, at 01:24, Rob Giardina wrote:
> This is a difficult JVM restriction. In another context, I would argue
> that this is the single biggest limitation against interesting
> dynamic/symbolic programming patterns in Java.
>
> One of the most elegant work-arounds for this restriction is to
> introduce a layer of indirection such that the scriptName maps to an
> arbitrary generated classname.

Or just have an indirection between the scriptName to the ClassLoader 
which loaded it. Then at any time you can ditch the ClassLoader, reload 
the script in a new ClassLoader and hey presto you've reloaded it.

This is how the GroovyScriptEngine works...

http://groovy.codehaus.org/xref/groovy/util/GroovyScriptEngine.html

which is used by the Groovlet engine to auto-reload scripts when 
they've changed. We should integrate this feature into the GroovyShell 
and elsewhere to allow this feature to be used in other places too.

James
-------
http://radio.weblogs.com/0112098/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic