TimedInterrupt annotation for executing scripts with GroovyShell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

TimedInterrupt annotation for executing scripts with GroovyShell

sterg
Hi all,


I tried o use @TimeInterrupt annotation with GroovyLab,

in order to interrupt scripts that take much time.


I implemented a TimedInterrupt mode,
in which GroovyLab inserts the line
@TimedInterrupt( ...)
before each script
and then passes the script to the GroovyShell for evaluate().

The timed interrupt works but unfortunately the binding of variables
fails to work properly.

I suspect that the TimedInterrupt annotation should be placed,
before the method run() of the script,
so a possible solution is to intervene at the Groovy's source code,
however that is not elegant,
since it requires compiling Groovy's source with GroovyLab.

Exists some other better solution?

Best Regards
Stergios