Hi All,
Please let me know if there is any way to stop a GroovyShell running within a java thread.
For instance,
Through my application I am spawning a Java Thread. This thread invokes GroovyShell by passing the script file to be executed (GroovyShell.
evaluate(File file)).
While executing, I require to stop the execution of script. Currently I am trying to stop the execution by calling Thread.interrupt(). This is not successful in stopping the Groovy script.
Infact, the AWT thread invokes interrupt and goes into wait(), probably waiting for thread running shell script to respond. Whereas the thread responds only when the Script is completed. This is not serving my purpose.
I intend to have a varible which could be polled intermitently while execution of script. Is it feasible to check status of a boolean variable after executing each line of the Script File? From within GroovyShell.evaluate() or outside.
Currently i am not able to stop my application, while GroovyShell.evaluate() is executing the script. Please provide me inputs on what approach i can follow.
--
Regards
- Nik
--
Leaders are "LONELY"
so be prepared to walk alone