public class JavascriptExecutor extends java.lang.Object implements java.lang.AutoCloseable, ScriptExecutor
ScriptExecutor.Installable| Constructor and Description |
|---|
JavascriptExecutor(ModuleScriptProvider scriptProvider,
Scriptable baseScope)
create instance.
|
| Modifier and Type | Method and Description |
|---|---|
AnyMap |
call(java.lang.String scriptFunction,
AnyMap arguments)
execute the function with the given map object.
|
Record |
call(java.lang.String scriptFunction,
Record record)
execute the function with the given record.
|
void |
close() |
void |
install(ScriptExecutor.Installable plugin) |
java.lang.Object |
loadScript(java.lang.String scriptFile)
load and execute file from scripting directory in this executor.
|
public JavascriptExecutor(ModuleScriptProvider scriptProvider,
Scriptable baseScope)
public java.lang.Object loadScript(java.lang.String scriptFile)
throws ScriptingEngineException
ScriptExecutorloadScript in interface ScriptExecutorscriptFile - Script file. Relative path some base directory, without suffix.ScriptingEngineException - error loading or executing scripts.public Record call(java.lang.String scriptFunction, Record record) throws ScriptingEngineException
ScriptExecutorScriptExecutor.loadScript(String) calls.call in interface ScriptExecutorscriptFunction - name of function. The function must be able to take one argument.record - record to process with the script.ScriptingEngineException - error processing the script.public AnyMap call(java.lang.String scriptFunction, AnyMap arguments) throws ScriptingEngineException
ScriptExecutorScriptExecutor.loadScript(String) calls.call in interface ScriptExecutorscriptFunction - name of function. The function must be able to take one argument.arguments - arguments to process.ScriptingEngineException - error processing the script.public void install(ScriptExecutor.Installable plugin) throws ScriptingEngineException
install in interface ScriptExecutorplugin - the extension to install to the ScriptExecutorScriptingEngineExceptionpublic void close()
close in interface java.lang.AutoCloseableclose in interface ScriptExecutor