there a way to stop the interpeter while
executing a script? The situation I have is
script my be monitering something in a polling
the user wants to cancel it. I provide a scriptIsTerminating
method on an object I make visible,
but if they
choose to ignore that, or are hung, I need a way
for force a
termination of the script.
You can use a deprecated method in java.lang.Thread to
stop the user thread. There is some example code in
In Sun's documentation of java.lang.Thread you'll also
find that the preferred way of doing this is to
send the thread an interrupt, but the thread should
check for being interrupted.
An alternative is java.lang.System.exit(),
but that might be too drastic...