public class ScriptExecutor extends Object
Constructor and Description |
---|
ScriptExecutor(ScriptEngineManager engineManager,
String engineName,
String command,
ClassLoader classLoader)
Create a new script executor
|
ScriptExecutor(ScriptEngineManager engineManager,
String engineName,
String command,
ClassLoader classLoader,
String sourceName)
Create a new script executor
|
ScriptExecutor(ScriptEngineManager engineManager,
String engineName,
URL commandUrl,
ClassLoader classLoader)
Create a new script executor
|
ScriptExecutor(ScriptEngine engine,
String command,
ClassLoader classLoader)
Construct a new script executors
|
ScriptExecutor(ScriptEngine engine,
String command,
ClassLoader classLoader,
String sourceName)
Construct a new script executors
|
ScriptExecutor(ScriptEngine engine,
URL commandUrl,
ClassLoader classLoader) |
ScriptExecutor(String engineName,
String command,
ClassLoader classLoader) |
ScriptExecutor(String engineName,
String command,
ClassLoader classLoader,
String sourceName) |
ScriptExecutor(String engineName,
URL commandUrl,
ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
applyVars(ScriptContext context,
Map<String,Object> scriptObjects) |
Object |
execute(ScriptContext scriptContext) |
Object |
execute(ScriptContext scriptContext,
Map<String,Object> scriptObjects) |
protected void |
restoreVars(ScriptContext context,
Map<String,Object> vars) |
String |
toString() |
public ScriptExecutor(String engineName, String command, ClassLoader classLoader) throws Exception
Exception
public ScriptExecutor(String engineName, String command, ClassLoader classLoader, String sourceName) throws Exception
Exception
public ScriptExecutor(String engineName, URL commandUrl, ClassLoader classLoader) throws Exception
Exception
public ScriptExecutor(ScriptEngineManager engineManager, String engineName, String command, ClassLoader classLoader) throws Exception
engineManager
- the engine manager to useengineName
- the name of the script enginecommand
- the scriptclassLoader
- the class loader the script should useException
- if anything goes wrongpublic ScriptExecutor(ScriptEngineManager engineManager, String engineName, String command, ClassLoader classLoader, String sourceName) throws Exception
engineManager
- the engine manager to useengineName
- the name of the script enginecommand
- the scriptclassLoader
- the class loader the script should usesourceName
- the name of the sourceException
- if anything goes wrongpublic ScriptExecutor(ScriptEngineManager engineManager, String engineName, URL commandUrl, ClassLoader classLoader) throws Exception
engineManager
- the engine manager to useengineName
- the name of the script enginecommandUrl
- the URL to the scriptclassLoader
- the class loader the script should useException
- if anything goes wrongpublic ScriptExecutor(ScriptEngine engine, String command, ClassLoader classLoader, String sourceName) throws Exception
engine
- the script engine to use, must not be null
command
- the command to execute, may be null
classLoader
- the class loader to use when executing, may be
null
ScriptException
Exception
public ScriptExecutor(ScriptEngine engine, String command, ClassLoader classLoader) throws Exception
engine
- the script engine to use, must not be null
command
- the command to execute, may be null
classLoader
- the class loader to use when executing, may be
null
ScriptException
Exception
public ScriptExecutor(ScriptEngine engine, URL commandUrl, ClassLoader classLoader) throws Exception
Exception
protected Map<String,Object> applyVars(ScriptContext context, Map<String,Object> scriptObjects)
protected void restoreVars(ScriptContext context, Map<String,Object> vars)
public Object execute(ScriptContext scriptContext) throws Exception
Exception
public Object execute(ScriptContext scriptContext, Map<String,Object> scriptObjects) throws Exception
Exception
Copyright © 2016 Eclipse NeoSCADA Project. All rights reserved.