public interface ScriptExecutor
extends java.lang.AutoCloseable
try (ScriptExecutor executor = scriptingEngine.getScriptExecutor()) {
executor.loadScript("myScript");
executor.call("myFunction", record);
}
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ScriptExecutor.Installable
Interface for object that add something to the ScriptExecutor.
|
| 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 extension) |
java.lang.Object |
loadScript(java.lang.String scriptFile)
load and execute file from scripting directory in this executor.
|
java.lang.Object loadScript(java.lang.String scriptFile)
throws ScriptingEngineException
scriptFile - Script file. Relative path some base directory, without suffix.ScriptingEngineException - error loading or executing scripts.Record call(java.lang.String scriptFunction, Record record) throws ScriptingEngineException
loadScript(String) calls.scriptFunction - name of function. The function must be able to take one argument.record - record to process with the script.ScriptingEngineException - error processing the script.AnyMap call(java.lang.String scriptFunction, AnyMap arguments) throws ScriptingEngineException
loadScript(String) calls.scriptFunction - name of function. The function must be able to take one argument.arguments - arguments to process.ScriptingEngineException - error processing the script.void install(ScriptExecutor.Installable extension) throws ScriptingEngineException
extension - the extension to install to the ScriptExecutorScriptingEngineExceptionvoid close()
close in interface java.lang.AutoCloseable