Created
February 5, 2010 22:05
-
-
Save yokolet/296317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/org/jruby/Ruby.java | |
+++ b/src/org/jruby/Ruby.java | |
@@ -195,6 +195,23 @@ public final class Ruby { | |
private static Ruby globalRuntime; | |
+ /** | |
+ * Tests whether globalRuntime has been instantiated or not. | |
+ * | |
+ * This method is used by singleton model of org.jruby.embed.ScriptingContainer | |
+ * to decide what RubyInstanceConfig should be used. When a global runtime is | |
+ * not there, RubyInstanceConfig of AbstractContextProvider will be used to enac | |
+ * configurations set by a user. When a global runtime is already instantiated, | |
+ * RubyInstanceConfig of the global runtime should be used in ScriptingContaiene | |
+ * | |
+ * @return true if a global runtime is instantiated, false for other. | |
+ * | |
+ */ | |
+ public static boolean isGlobalRuntimeReady() { | |
+ if (globalRuntime == null) return false; | |
+ else return true; | |
+ } | |
+ | |
private static synchronized void setGlobalRuntimeFirstTimeOnly(Ruby runtime) { | |
if (globalRuntime == null) { | |
globalRuntime = runtime; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment