Changeset 13059


Ignore:
Timestamp:
11/27/10 21:08:26 (11 years ago)
Author:
vvoutilainen
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngineFactory.java

    r12749 r13059  
    3030public class AbclScriptEngineFactory implements ScriptEngineFactory {
    3131
    32     private static final AbclScriptEngine THE_ONLY_ONE_ENGINE = new AbclScriptEngine();
     32    private static AbclScriptEngine THE_ONLY_ONE_ENGINE = null;
    3333 
    3434    public String getEngineName() {
     
    117117   
    118118    public ScriptEngine getScriptEngine() {
     119        if (THE_ONLY_ONE_ENGINE == null) {
     120            THE_ONLY_ONE_ENGINE = new AbclScriptEngine();
     121        }
    119122  return THE_ONLY_ONE_ENGINE;
    120123    }
Note: See TracChangeset for help on using the changeset viewer.