public abstract class ScriptExecutorFactory extends Object
NOTE: This is intended purely for executing java-embedable scripting
languages. That is, the execution model is assumed to be same-JVM, so scripts
can have side effects on objects passed to the script. This is used
internally by the connector framework in its implementation of
ScriptOnConnectorApiOp
and should be used by connectors should they
need to have a custom implementation of ScriptOnConnectorOp
. This is
not intended for use by connectors that implement
ScriptOnResourceOp
.
Constructor and Description |
---|
ScriptExecutorFactory() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getLanguageName()
Returns the name of the language supported by this factory.
|
static Set<String> |
getSupportedLanguages()
Returns the set of supported languages.
|
static ScriptExecutorFactory |
newInstance(String language)
Creates a ScriptExecutorFactory for the given language.
|
abstract ScriptExecutor |
newScriptExecutor(ClassLoader loader,
String script,
boolean compile)
Creates a script executor for the given script.
|
public static Set<String> getSupportedLanguages()
public static ScriptExecutorFactory newInstance(String language)
language
- The name of the languageIllegalArgumentException
- If the given language is not supported.public abstract ScriptExecutor newScriptExecutor(ClassLoader loader, String script, boolean compile)
loader
- The classloader that contains the java classes that the script should have access to.script
- The script text.compile
- A hint to tell the script executor whether or not to compile the given script.
This need not be implemented by all script executors. If true, the caller is saying that they intend to
call the script multiple times with different arguments, so compile if possible.public abstract String getLanguageName()
Copyright © 2022. All rights reserved.