public abstract class EngineScriptKnowledgeBaseInterpreter extends BaseScriptKnowledgeBaseInterpreter
interpteterSynchro, PROP_PATH_SEPARATOR, scriptClassInstancePovider| Modifier | Constructor and Description |
|---|---|
protected |
EngineScriptKnowledgeBaseInterpreter(KnowledgeBaseEngineOperations engineOperations,
KnowledgeBaseType type)
Creates a new Knowledge Interpreter.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T> ScriptClassInstanceProvider<T> |
createScriptClassInstancePovider() |
protected abstract ScriptEngine |
createScriptEngine()
Creates scripting engine.
|
<T> T |
eval(Reader reader,
String fileName) |
protected <T> T |
eval(ScriptEngine scriptEngine,
String expression) |
<T> T |
eval(String expression) |
boolean |
existsVariable(String name) |
protected Invocable |
getInvocable() |
Throwable |
getJavaException(Throwable knowledgeBaseException) |
protected abstract String |
getScriptClassInstancePoviderFormat() |
ScriptEngine |
getScriptEngine() |
Object |
getVariable(String name) |
<T> T |
invokeFunction(String name,
Class<T> cls,
Object... args) |
Object |
invokeMethod(Object target,
String name,
Object... args) |
<T> T |
invokeOptionalFunction(String name,
T defaultValue) |
boolean |
isKnowledgeBaseException(Throwable exception) |
void |
onClear()
Clears the interpreter state.
|
protected void |
prepareInterpreter()
Prepares the interpreter.
|
String |
resolveVariableName(Object value) |
protected void |
setScriptEngine(ScriptEngine scriptEngine) |
void |
setVariable(String name,
Object value)
Sets the variable value.
|
createInterpreterInstance, createProcessorInstanceByProcessorClass, doCreateInstance, doLoad, doReload, eval, getStandardImportClasses, invalidateCache, isProcessorAbstract, load, load, load, load, load, load, onAfterReload, onBeforeReload, onInit, onLoad, onRun, onShutdown, onStartup, reloadcreatePluginInstance, createProcessorInstance, getCustomRuleEventSpec, getEngineOperations, getLogger, getRuleEventSpec, getSpecificExceptionMessage, getType, getVariable, resolveEventNameAndAliasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitscanToAutoEnablecreatePluginInstance, createProcessorInstance, getEngineOperations, getRuleEventSpec, getScriptKnowledgeBaseProcessorClassName, getSpecificExceptionMessage, getType, getVariableprotected EngineScriptKnowledgeBaseInterpreter(KnowledgeBaseEngineOperations engineOperations, KnowledgeBaseType type)
engineOperations - an engine operations.type - a knowledge base type.protected abstract String getScriptClassInstancePoviderFormat()
protected abstract ScriptEngine createScriptEngine()
protected void prepareInterpreter()
prepareInterpreter in class BaseScriptKnowledgeBaseInterpreterpublic void onClear()
protected Invocable getInvocable()
public <T> T invokeOptionalFunction(String name, T defaultValue)
public void setVariable(String name, Object value)
name - variable name.value - variable value.public boolean existsVariable(String name)
public <T> T eval(String expression)
protected <T> T eval(ScriptEngine scriptEngine, String expression)
public <T> T eval(Reader reader, String fileName)
eval in class BaseScriptKnowledgeBaseInterpreterpublic ScriptEngine getScriptEngine()
public boolean isKnowledgeBaseException(Throwable exception)
protected <T> ScriptClassInstanceProvider<T> createScriptClassInstancePovider()
createScriptClassInstancePovider in class BaseScriptKnowledgeBaseInterpreterprotected void setScriptEngine(ScriptEngine scriptEngine)
Copyright © 2016–2018 Softelnet. All rights reserved.