Class ScriptingEngines
java.lang.Object
org.camunda.bpm.engine.impl.scripting.engine.ScriptingEngines
- All Implemented Interfaces:
DmnScriptEngineResolver
Manager for JSR-223 ScriptEngine
handling.
Resolving a script engine:
This class supports resolving a script engine for a given 'language name' (eg. 'groovy').
If the configuration option enableScriptEngineCaching
is set to true,
the class will attempt to cache 'cachable' script engines. We assume a ScriptEngine
is
'cachable' if it declares to be threadsafe (see #isCachable(ScriptEngine)
)
Custom Bindings: this class supports custom Bindings
implementations through the scriptBindingsFactory
. See ScriptBindingsFactory
.
- Author:
- Tom Baeyens, Daniel Meyer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
protected boolean
static final String
static final String
static final String
protected ScriptBindingsFactory
protected ScriptEngineResolver
-
Constructor Summary
ConstructorDescriptionScriptingEngines
(ScriptBindingsFactory scriptBindingsFactory, ScriptEngineResolver scriptEngineResolver) ScriptingEngines
(ScriptEngineResolver scriptEngineResolver) -
Method Summary
Modifier and TypeMethodDescriptionaddScriptEngineFactory
(ScriptEngineFactory scriptEngineFactory) createBindings
(ScriptEngine scriptEngine, VariableScope variableScope) override to build a spring aware ScriptingEnginesprotected ScriptEngine
getGlobalScriptEngine
(String language) protected ScriptEngine
getPaScriptEngine
(String language, ProcessApplicationReference pa) getScriptEngineForLanguage
(String language) Loads the given script engine by language name.boolean
void
setEnableScriptEngineCaching
(boolean enableScriptEngineCaching) void
setScriptBindingsFactory
(ScriptBindingsFactory scriptBindingsFactory) void
setScriptEngineResolver
(ScriptEngineResolver scriptEngineResolver)
-
Field Details
-
DEFAULT_SCRIPTING_LANGUAGE
- See Also:
-
GROOVY_SCRIPTING_LANGUAGE
- See Also:
-
JAVASCRIPT_SCRIPTING_LANGUAGE
- See Also:
-
ECMASCRIPT_SCRIPTING_LANGUAGE
- See Also:
-
GRAAL_JS_SCRIPT_ENGINE_NAME
- See Also:
-
DEFAULT_JS_SCRIPTING_LANGUAGE
- See Also:
-
scriptEngineResolver
-
scriptBindingsFactory
-
enableScriptEngineCaching
protected boolean enableScriptEngineCaching
-
-
Constructor Details
-
ScriptingEngines
public ScriptingEngines(ScriptBindingsFactory scriptBindingsFactory, ScriptEngineResolver scriptEngineResolver) -
ScriptingEngines
-
-
Method Details
-
isEnableScriptEngineCaching
public boolean isEnableScriptEngineCaching() -
setEnableScriptEngineCaching
public void setEnableScriptEngineCaching(boolean enableScriptEngineCaching) -
getScriptEngineManager
-
addScriptEngineFactory
-
getScriptEngineForLanguage
Loads the given script engine by language name. Will throw an exception if no script engine can be loaded for the given language name.- Specified by:
getScriptEngineForLanguage
in interfaceDmnScriptEngineResolver
- Parameters:
language
- the name of the script language to lookup an implementation for- Returns:
- the script engine
- Throws:
ProcessEngineException
- if no such engine can be found.
-
getPaScriptEngine
-
getGlobalScriptEngine
-
createBindings
override to build a spring aware ScriptingEngines- Parameters:
engineBindin
-scriptEngine
-
-
getScriptBindingsFactory
-
setScriptBindingsFactory
-
setScriptEngineResolver
-