[jira] [Commented] (GROOVY-1705) stop running GroovyScriptEngine

2017-10-17 Thread Jochen Theodorou (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16208116#comment-16208116
 ] 

Jochen Theodorou commented on GROOVY-1705:
--

See http://docs.groovy-lang.org/next/html/documentation/#_safer_scripting for 
transforms that do give you the ability to interrupt scripts. Even though the 
original message is 5 years old, the idea of adding the transform to the 
configuration used by the script engine is still the right now. See also 
http://mrhaki.blogspot.de/2011/06/groovy-goodness-add-asttransformations.html 
for how to use the transform

> stop running GroovyScriptEngine
> ---
>
> Key: GROOVY-1705
> URL: https://issues.apache.org/jira/browse/GROOVY-1705
> Project: Groovy
>  Issue Type: Improvement
>  Components: GroovyScriptEngine
>Affects Versions: 1.0-JSR-6
> Environment: OS:WindowsXp
>Reporter: Rajendra Kothari
>Assignee: Jochen Theodorou
> Fix For: 1.8.0
>
>
> Once GroovyScriptEngine starts executing a script it does stop untill it 
> finish whole script. There should be mechanism to stop a running script.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GROOVY-1705) stop running GroovyScriptEngine

2017-10-17 Thread Evgeni Kumanov (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16207986#comment-16207986
 ] 

Evgeni Kumanov commented on GROOVY-1705:


Jochen Theodorou, can you elaborate more on that solution? I'm not familiar 
with groovy, I am a Java developer and currently trying to fix something in an 
existing project: being able to stop a running groovy script execution. Is 
there an easy Java solution? I see you suggest a compiler configuration but I 
don't know what that means in details. Can you give me an example? Also, I see 
this issue has been fixed but I can't see how and what's the solution for 
stopping scripts. What I seek is a very simple solution for stopping script 
execution from Java without having to rely on groovy transformations (if I 
understand correctly what that means, namely adding some groovy stuff to the 
scripts that will wrap them in a stoppable logic?).

> stop running GroovyScriptEngine
> ---
>
> Key: GROOVY-1705
> URL: https://issues.apache.org/jira/browse/GROOVY-1705
> Project: Groovy
>  Issue Type: Improvement
>  Components: GroovyScriptEngine
>Affects Versions: 1.0-JSR-6
> Environment: OS:WindowsXp
>Reporter: Rajendra Kothari
>Assignee: Jochen Theodorou
> Fix For: 1.8.0
>
>
> Once GroovyScriptEngine starts executing a script it does stop untill it 
> finish whole script. There should be mechanism to stop a running script.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)