Package org.infinispan.scripting
Interface ScriptingManager
public interface ScriptingManager
ScriptingManager. Defines the operations that can be performed on scripts. Scripts are stored in
a dedicated cache.
- Since:
- 7.2
- Author:
- Tristan Tarrant
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new named script.Retrieves the source code of an existing script.Retrieves names of all available scripts.void
removeScript
(String name) Removes a script.<T> CompletionStage
<T> Runs a named script<T> CompletionStage
<T> runScript
(String scriptName, TaskContext context) Runs a named script using the specifiedTaskContext
-
Field Details
-
SCRIPT_CACHE
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
SCRIPT_MANAGER_ROLE
Deprecated, for removal: This API element is subject to removal in a future version.since 12.1. Will be removed in 15.0. Use the CREATE permission instead.- See Also:
-
-
Method Details
-
addScript
Adds a new named script.- Parameters:
name
- the name of the script. The name should contain an extension identifying its languagescript
- the source of the script
-
removeScript
Removes a script.- Parameters:
name
- the name of the script ro remove
-
runScript
Runs a named script- Parameters:
scriptName
- The name of the script to run. UseaddScript(String, String)
to add a script- Returns:
- a
CompletableFuture
which will return the result of the script execution
-
runScript
Runs a named script using the specifiedTaskContext
- Parameters:
scriptName
- The name of the script to run. UseaddScript(String, String)
to add a scriptcontext
- ATaskContext
within which the script will be executed- Returns:
- a
CompletableFuture
which will return the result of the script execution
-
getScript
Retrieves the source code of an existing script.- Parameters:
scriptName
- The name of the script- Returns:
- the source code of the script
-
getScriptNames
Retrieves names of all available scripts.
-