Package org.elasticsearch.script
Interface ScriptEngine
-
- All Superinterfaces:
AutoCloseable,Closeable
public interface ScriptEngine extends Closeable
A script language implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()<FactoryType>
FactoryTypecompile(String name, String code, ScriptContext<FactoryType> context, Map<String,String> params)Compiles a script.StringgetType()The language name used in the script APIs to refer to this scripting backend.
-
-
-
Method Detail
-
getType
String getType()
The language name used in the script APIs to refer to this scripting backend.
-
compile
<FactoryType> FactoryType compile(String name, String code, ScriptContext<FactoryType> context, Map<String,String> params)
Compiles a script.- Parameters:
name- the name of the script.nullif it is anonymous (inline). For a stored script, its the identifier.code- actual source of the scriptcontext- the context this script will be used forparams- compile-time parameters (such as flags to the compiler)- Returns:
- A compiled script of the FactoryType from
ScriptContext
-
close
default void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-