[armedbear-cvs] r13059 - trunk/abcl/src/org/armedbear/lisp/scripting

Ville Voutilainen vvoutilainen at common-lisp.net
Sat Nov 27 21:08:29 UTC 2010


Author: vvoutilainen
Date: Sat Nov 27 16:08:26 2010
New Revision: 13059

Log:
Delay the instantiation of the script engine until it's
actually requested. This will allow jsr-223 clients to
query for the engine metadata without instantiating the
engine. Reported by Martin Hepperle.


Modified:
   trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngineFactory.java

Modified: trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngineFactory.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngineFactory.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngineFactory.java	Sat Nov 27 16:08:26 2010
@@ -29,7 +29,7 @@
 
 public class AbclScriptEngineFactory implements ScriptEngineFactory {
 
-    private static final AbclScriptEngine THE_ONLY_ONE_ENGINE = new AbclScriptEngine();
+    private static AbclScriptEngine THE_ONLY_ONE_ENGINE = null;
 	
     public String getEngineName() {
 	return "ABCL Script";
@@ -116,6 +116,9 @@
     }
     
     public ScriptEngine getScriptEngine() {
+        if (THE_ONLY_ONE_ENGINE == null) {
+            THE_ONLY_ONE_ENGINE = new AbclScriptEngine();
+        }
 	return THE_ONLY_ONE_ENGINE;
     }
 




More information about the armedbear-cvs mailing list