ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: ScriptDef revisited
Date Wed, 31 Dec 2003 11:24:04 GMT
You could try playing with beanshelldef


Jose Alberto Fernandez wrote:

>my current struggle with <script/> and beanshell, made me notice how
>or script task is (i.e., on every execution the script is recompiled,
>and executed).
>Although there is no other way for <script/> it would be nice is
>could do something more efficient. Currently <scriptdef/> will recompile
>src on every invocation of the defined script.
>It would be nice if we could somehow cache the already parsed source,
>being able to reexecute it multiple times with different element and
>instances on each execution. So, to treat it a little more like compiled
>The way I see it, such a script definition would specify an expression
>that can be called over and over. Something like:
> <scripdef name="myscript" language="beanshell"
>   <attribute name="att1"/>
>   void executeScript() {
>     print (attributes.get("att1"));
>   }
> </scriptdef>
>The execute attribute indicates the expression to be evaluated
>on each <myscript/> instance, and it also indicates that it is safe
>to keep the compiled source (i.e., bsf engine object around).
>Notice that it may not be thread-safe to do this since the engine
>is statefull. hummmm
>So, what do people think?
>Jose Alberto
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message