Class AbstractCachingScriptEvaluator<I,C,K>
java.lang.Object
com.evolveum.midpoint.model.common.expression.script.AbstractScriptEvaluator
com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator<I,C,K>
- Type Parameters:
I- script interpreter/compiler/runtimeC- compiled codeK- code caching key (e.g. source code)
- All Implemented Interfaces:
ScriptEvaluator
- Direct Known Subclasses:
GroovyScriptEvaluator,Jsr223ScriptEvaluator,MelScriptEvaluator
Script evaluator that caches compiled scripts in
scriptCache.- Author:
- Radovan Semancik
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractCachingScriptEvaluator(PrismContext prismContext, Protector protector, LocalizationService localizationService) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CcompileScript(String codeString, ScriptExpressionEvaluationContext context) protected abstract I@Nullable ObjectevaluateInternal(@NotNull String codeString, @NotNull ScriptExpressionEvaluationContext context) Executes the evaluation.protected abstract ObjectevaluateScript(C compiledScript, ScriptExpressionEvaluationContext context) protected Iprotected @NotNull ScriptCache<I,C, K> protected abstract KgetScriptCachingKey(String codeString, ScriptExpressionEvaluationContext context) Methods inherited from class com.evolveum.midpoint.model.common.expression.script.AbstractScriptEvaluator
doesSupportRestrictions, evaluate, getLocalizationService, getPrismContext, getProtector, needsServiceVariables, prepareFunctionLibraryMap, prepareScriptVariablesMap, prepareScriptVariablesTypedValueMap, prepareUnifiedScriptVariablesValueMap, supportsDeprecatedVariablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.model.common.expression.script.ScriptEvaluator
getLanguageName, getLanguageUrl, isInitialized
-
Constructor Details
-
AbstractCachingScriptEvaluator
public AbstractCachingScriptEvaluator(PrismContext prismContext, Protector protector, LocalizationService localizationService)
-
-
Method Details
-
getScriptCache
-
evaluateInternal
@Nullable public @Nullable Object evaluateInternal(@NotNull @NotNull String codeString, @NotNull @NotNull ScriptExpressionEvaluationContext context) throws Exception Description copied from class:AbstractScriptEvaluatorExecutes the evaluation. Responsible for incrementing respectiveInternalCounters.- Specified by:
evaluateInternalin classAbstractScriptEvaluator- Throws:
Exception
-
getInterpreter
protected I getInterpreter(ScriptExpressionEvaluationContext context) throws SecurityViolationException, ConfigurationException -
createInterpreter
protected abstract I createInterpreter(ScriptExpressionEvaluationContext context) throws SecurityViolationException, ConfigurationException -
getScriptCachingKey
protected abstract K getScriptCachingKey(String codeString, ScriptExpressionEvaluationContext context) throws SchemaException, ExpressionEvaluationException, CommunicationException, SecurityViolationException, ConfigurationException, ObjectNotFoundException -
compileScript
protected abstract C compileScript(String codeString, ScriptExpressionEvaluationContext context) throws Exception - Throws:
Exception
-
evaluateScript
protected abstract Object evaluateScript(C compiledScript, ScriptExpressionEvaluationContext context) throws Exception - Throws:
Exception
-