/** * Make sure Kernel#at_exit procs get invoked on runtime shutdown. * This method needs to be explicitly called to work properly. * I thought about using finalize(), but that did not work and I * am not sure the runtime will be at a state to run procs by the * time Ruby is going away. This method can contain any other * things that need to be cleaned up at shutdown. */ public void tearDown() { tearDown(true); }
/** * Dispose of the runtime you initialized. * * @param runtime to be disposed of */ public static void terminate(Ruby runtime) { runtime.tearDown(); }
/** * Make sure Kernel#at_exit procs get invoked on runtime shutdown. * This method needs to be explicitly called to work properly. * I thought about using finalize(), but that did not work and I * am not sure the runtime will be at a state to run procs by the * time Ruby is going away. This method can contain any other * things that need to be cleaned up at shutdown. */ public void tearDown() { tearDown(true); }
/** * Dispose of the runtime you initialized. * * @param runtime to be disposed of */ public static void terminate(Ruby runtime) { runtime.tearDown(); }
/** * Make sure Kernel#at_exit procs getService invoked on runtime shutdown. * This method needs to be explicitly called to work properly. * I thought about using finalize(), but that did not work and I * am not sure the runtime will be at a state to run procs by the * time Ruby is going away. This method can contain any other * things that need to be cleaned up at shutdown. */ public void tearDown() { tearDown(true); }
@Override public void shutdown() { this.rubyRuntime.tearDown(); }
/** * Make sure Kernel#at_exit procs getService invoked on runtime shutdown. * This method needs to be explicitly called to work properly. * I thought about using finalize(), but that did not work and I * am not sure the runtime will be at a state to run procs by the * time Ruby is going away. This method can contain any other * things that need to be cleaned up at shutdown. */ public void tearDown() { tearDown(true); }
/** * Dispose of the runtime you initialized. * * @param runtime to be disposed of */ public static void terminate(Ruby runtime) { runtime.tearDown(); }
/** * Dispose of the runtime you initialized. * * @param runtime to be disposed of */ public static void terminate(Ruby runtime) { runtime.tearDown(); }
@Override public void destroy() { runtime.tearDown(false); }
@Override public void shutdown() { this.rubyRuntime.tearDown(); }
public void run() { if (didTeardown.compareAndSet(false, true)) { runtime.tearDown(); } } });
public void run() { if (didTeardown.compareAndSet(false, true)) { runtime.tearDown(); } } });
public void run() { if (didTeardown.compareAndSet(false, true)) { runtime.tearDown(); } } });
public void run() { if (didTeardown.compareAndSet(false, true)) { runtime.tearDown(); } } });
private void forceStopRubyThreads() { // if the container is disposed already, bail out if (data.container == null) return; // try to kill all threads once if (!data.forcedHalt) { data.forcedHalt = true; } else { return; } if (data.runtime != null) { RubyThread[] threads = data.runtime.getThreadService().getActiveRubyThreads(); for (int i = 0; i < threads.length; i++) { try { threads[i].kill(); } catch (ThreadKill e) { } } data.runtime.tearDown(); } }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { if (getProvider().isRuntimeInitialized()) getProvider().getRuntime().tearDown(false); getProvider().terminate(); }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { if (getProvider().isRuntimeInitialized()) getProvider().getRuntime().tearDown(false); getProvider().terminate(); }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { LocalContextProvider provider = getProvider(); if (provider.isRuntimeInitialized()) { provider.getRuntime().tearDown(false); provider.getRuntime().releaseClassLoader(); } provider.terminate(); }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { LocalContextProvider provider = getProvider(); if (provider.isRuntimeInitialized()) { provider.getRuntime().tearDown(false); provider.getRuntime().releaseClassLoader(); } provider.terminate(); }