Class AbstractScript
java.lang.Object
org.tentackle.script.AbstractScript
- All Implemented Interfaces:
Script
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractScript(ScriptingLanguage language, String code, boolean cached, boolean threadSafe) Creates a script. -
Method Summary
Modifier and TypeMethodDescription<T> Texecute(ScriptVariable... variables) Executes a script.getCode()Gets the scripting source code.Gets the scripting language.booleanisCached()Returns whether there is only one compiled script for the same code.booleanReturns whether script may be invoked from more than one thread in parallel.toString()
-
Constructor Details
-
AbstractScript
Creates a script.- Parameters:
language- the language instancecode- the scripting codecached- true to use caching, if possiblethreadSafe- true if thread-safety is required
-
-
Method Details
-
toString
-
getLanguage
Description copied from interface:ScriptGets the scripting language.- Specified by:
getLanguagein interfaceScript- Returns:
- the language
-
isThreadSafe
public boolean isThreadSafe()Description copied from interface:ScriptReturns whether script may be invoked from more than one thread in parallel.- Specified by:
isThreadSafein interfaceScript- Returns:
- true if thread-safe execution required, false if parallel execution allowed
-
isCached
-
getCode
-
execute
Description copied from interface:ScriptExecutes a script.Throws
ScriptRuntimeExceptionif execution failed.
ThrowsIllegalArgumentExceptionif there are any duplicate variable names.
-