Package org.infinispan.scripting.impl
Class ScriptingManagerImpl
- java.lang.Object
-
- org.infinispan.scripting.impl.ScriptingManagerImpl
-
- All Implemented Interfaces:
ScriptingManager
public class ScriptingManagerImpl extends Object implements ScriptingManager
ScriptingManagerImpl.- Since:
- 7.2
- Author:
- Tristan Tarrant
-
-
Field Summary
-
Fields inherited from interface org.infinispan.scripting.ScriptingManager
SCRIPT_CACHE, SCRIPT_MANAGER_ROLE
-
-
Constructor Summary
Constructors Constructor Description ScriptingManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddScript(String name, String script)Adds a new named script.StringgetScript(String name)Retrieves the source code of an existing script.Set<String>getScriptNames()Retrieves names of all available scripts.voidremoveScript(String name)Removes a script.<T> CompletionStage<T>runScript(String scriptName)Runs a named script<T> CompletionStage<T>runScript(String scriptName, org.infinispan.tasks.TaskContext context)Runs a named script using the specifiedTaskContextvoidstart()
-
-
-
Method Detail
-
start
public void start()
-
addScript
public void addScript(String name, String script)
Description copied from interface:ScriptingManagerAdds a new named script.- Specified by:
addScriptin interfaceScriptingManager- Parameters:
name- the name of the script. The name should contain an extension identifying its languagescript- the source of the script
-
removeScript
public void removeScript(String name)
Description copied from interface:ScriptingManagerRemoves a script.- Specified by:
removeScriptin interfaceScriptingManager- Parameters:
name- the name of the script ro remove
-
getScript
public String getScript(String name)
Description copied from interface:ScriptingManagerRetrieves the source code of an existing script.- Specified by:
getScriptin interfaceScriptingManager- Parameters:
name- The name of the script- Returns:
- the source code of the script
-
getScriptNames
public Set<String> getScriptNames()
Description copied from interface:ScriptingManagerRetrieves names of all available scripts.- Specified by:
getScriptNamesin interfaceScriptingManager- Returns:
Setcontaining names of available scripts.
-
runScript
public <T> CompletionStage<T> runScript(String scriptName)
Description copied from interface:ScriptingManagerRuns a named script- Specified by:
runScriptin interfaceScriptingManager- Parameters:
scriptName- The name of the script to run. UseScriptingManager.addScript(String, String)to add a script- Returns:
- a
CompletableFuturewhich will return the result of the script execution
-
runScript
public <T> CompletionStage<T> runScript(String scriptName, org.infinispan.tasks.TaskContext context)
Description copied from interface:ScriptingManagerRuns a named script using the specifiedTaskContext- Specified by:
runScriptin interfaceScriptingManager- Parameters:
scriptName- The name of the script to run. UseScriptingManager.addScript(String, String)to add a scriptcontext- ATaskContextwithin which the script will be executed- Returns:
- a
CompletableFuturewhich will return the result of the script execution
-
-