|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment
public class ScriptingEnvironment
The scripting environment contains scripts that provide an environment to a user provided script. The environment may contain additional libraries or imports.
The environment performs lazy initialization of scripts: the first time a script of a given
script language is executed, the environment will use the ScriptEnvResolvers
for resolving the environment scripts for that language. The scripts (if any) are then pre-compiled
and cached for reuse.
| Field Summary | |
|---|---|
protected Map<String,List<ExecutableScript>> |
env
the cached environment scripts per script language |
protected List<ScriptEnvResolver> |
envResolvers
the resolvers |
protected ScriptFactory |
scriptFactory
the script factory used for compiling env scripts |
protected ScriptingEngines |
scriptingEngines
the scripting engines |
| Constructor Summary | |
|---|---|
ScriptingEnvironment(ScriptFactory scriptFactory,
List<ScriptEnvResolver> scriptEnvResolvers,
ScriptingEngines scriptingEngines)
|
|
| Method Summary | |
|---|---|
Object |
execute(ExecutableScript script,
VariableScope scope)
execute a given script in the environment |
Object |
execute(ExecutableScript script,
VariableScope scope,
Bindings bindings,
ScriptEngine scriptEngine)
|
protected List<ExecutableScript> |
getEnvScripts(String scriptLanguage)
Returns the env scripts for the given language. |
protected List<ExecutableScript> |
initEnvForLanguage(String language)
Initializes the env scripts for a given language. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,List<ExecutableScript>> env
protected List<ScriptEnvResolver> envResolvers
protected ScriptFactory scriptFactory
protected ScriptingEngines scriptingEngines
| Constructor Detail |
|---|
public ScriptingEnvironment(ScriptFactory scriptFactory,
List<ScriptEnvResolver> scriptEnvResolvers,
ScriptingEngines scriptingEngines)
| Method Detail |
|---|
public Object execute(ExecutableScript script,
VariableScope scope)
script - the ExecutableScript to executescope - the scope in which to execute the script
public Object execute(ExecutableScript script,
VariableScope scope,
Bindings bindings,
ScriptEngine scriptEngine)
protected List<ExecutableScript> getEnvScripts(String scriptLanguage)
scriptLanguage - the language
protected List<ExecutableScript> initEnvForLanguage(String language)
language - the language
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||