public interface ScriptingManager
| Modifier and Type | Field and Description |
|---|---|
static String |
SCRIPT_CACHE |
static String |
SCRIPT_MANAGER_ROLE |
| Modifier and Type | Method and Description |
|---|---|
void |
addScript(String name,
String script)
Adds a new named script.
|
String |
getScript(String scriptName)
Retrieves the source code of an existing script.
|
Set<String> |
getScriptNames()
Retrieves names of all available scripts.
|
void |
removeScript(String name)
Removes a script.
|
<T> CompletableFuture<T> |
runScript(String scriptName)
Runs a named script
|
<T> CompletableFuture<T> |
runScript(String scriptName,
TaskContext context)
Runs a named script using the specified
TaskContext |
static final String SCRIPT_CACHE
static final String SCRIPT_MANAGER_ROLE
void addScript(String name, String script)
name - the name of the script. The name should contain an extension identifying its
languagescript - the source of the scriptvoid removeScript(String name)
name - the name of the script ro remove<T> CompletableFuture<T> runScript(String scriptName)
scriptName - The name of the script to run. Use addScript(String, String) to add a scriptCompletableFuture which will return the result of the script execution<T> CompletableFuture<T> runScript(String scriptName, TaskContext context)
TaskContextscriptName - The name of the script to run. Use addScript(String, String) to add a scriptcontext - A TaskContext within which the script will be executedCompletableFuture which will return the result of the script executionString getScript(String scriptName)
scriptName - The name of the scriptCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.