. ( , ...):
import org.jruby.Ruby;
class JRubyStop {
public static void main(String[] args) throws InterruptedException {
final Ruby jruby = Ruby.newInstance();
Thread jrubyThread = new Thread() {
public void run() {
String scriptlet = "for i in 0..100; puts i; sleep(1); end";
jruby.evalScriptlet(scriptlet);
}
};
jrubyThread.start();
Thread.sleep(5000);
System.out.println("interrupt!");
jrubyThread.interrupt();
System.out.println("interrupted?!");
}
}
"?!" , .
: Groovy Java SSCCE (http://sscce.org/).