Skip to content

How to evaluate a script programmatically_125272078

nxi edited this page Apr 9, 2015 · 1 revision

Gumtree : How to evaluate a script programmatically

Created by Tony Lam, last modified on Jul 14, 2009
There are two ways of evaluating scripts in GumTree, depending on which thread you are running:
  • Running under the current thread: use script engine (JSR-223 API)
  • Running under a separate thread: use the script executor (wrapper to script engine)
Examples on creating script engine:
// Gets a new instance of default scripting engine
ScriptingCore.getScriptingManager().createEngine();

// Gets a new instance of JEPP engine
ScriptingCore.getScriptingManager().createEngine("jep");
Examples on creating script executor:
// Gets a new instance of executor with default scripting engine
new ScriptExecutor();

// Gets a new instance of executor with JEPP engine
new ScriptExecutor("jep");
Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally