Class ScriptEnginePool

java.lang.Object
se.datadosen.jalbum.ScriptEnginePool

public class ScriptEnginePool extends Object
Pool of ScriptEngines, providing lazy loading and sharing of ScriptContext (variables)
Since:
12.3
  • Field Details

    • profiler

      public static final Profiler profiler
  • Constructor Details

    • ScriptEnginePool

      public ScriptEnginePool()
    • ScriptEnginePool

      public ScriptEnginePool(ClassLoader classLoader)
  • Method Details

    • getScriptEngineManager

      public ScriptEngineManager getScriptEngineManager()
    • get

      public ScriptEngine get(ScriptLanguage language)
      Get scripting engine by language
      Returns:
    • getSharedContext

      public ScriptContext getSharedContext()
    • getVar

      public static Object getVar(String name, ScriptEngine se)
      Fix for broken ScriptEngine.get implementation in BeanShell Variables that are redeclared within functions aren't synchronized with the Bindings object of ScriptEngine However, they are picked up by a NameSpace variable stored within the Bindings, so get it from there instead
      Parameters:
      name -
      Returns:
      Variable value (unwrapped) or null if not declared
      Since:
      12.3