public abstract class BaseScriptKnowledgeBaseInterpreter extends BaseKnowledgeBaseInterpreter implements ScriptKnowledgeBaseInterpreter
| Modifier and Type | Field and Description |
|---|---|
protected Object |
interpteterSynchro
Synchronization processor.
|
static String |
PROP_PATH_SEPARATOR |
protected ScriptClassInstanceProvider |
scriptClassInstancePovider |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseScriptKnowledgeBaseInterpreter(KnowledgeBaseEngineOperations engineOperations,
KnowledgeBaseType type)
Creates a new knowledge base interpreter.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract ScriptKnowledgeBaseInterpreter |
createInterpreterInstance(SpongeEngine engine,
KnowledgeBase knowledgeBase) |
ProcessorInstanceHolder |
createProcessorInstanceByProcessorClass(KnowledgeBase knowledgeBase,
Object processorClass,
Class<?> javaClass) |
protected abstract <T> ScriptClassInstanceProvider<T> |
createScriptClassInstancePovider() |
protected <T> T |
doCreateInstance(String className,
Class<T> javaClass)
Creates an instance of the given class.
|
protected void |
doLoad(Reader reader,
String name) |
protected void |
doReload(List<KnowledgeBaseScript> scripts) |
abstract <T> T |
eval(Reader reader,
String filename) |
<T> T |
eval(String expression,
Class<T> cls) |
protected Map<Class<?>,Class<?>> |
getProcessorClasses() |
protected Map<Class<?>,Class<?>> |
getSimplifiedImportClasses() |
protected List<Class<?>> |
getStandardImportClasses() |
protected void |
invalidateCache() |
protected boolean |
isProcessorAbstract(String className) |
void |
load(KnowledgeBaseScript script) |
void |
load(List<KnowledgeBaseScript> scripts) |
void |
load(String filename)
Loads the knowledge base from the file.
|
void |
load(String filename,
Charset charset) |
void |
load(String filename,
Charset charset,
boolean required) |
void |
load(String filename,
String charset)
Loads the knowledge base from the file.
|
void |
onAfterLoad() |
void |
onAfterReload()
Calls onAfterReload method in the knowledge base.
|
void |
onBeforeLoad() |
void |
onBeforeReload()
Calls onBeforeReload method in the knowledge base.
|
void |
onInit() |
void |
onLoad() |
boolean |
onRun() |
void |
onShutdown()
Calls onShutdown method in the knowledge base.
|
void |
onStartup()
Calls onStartup method in the knowledge base.
|
protected void |
overwriteProcessorBuilderClass(Class<?> interfaceCls,
Class<?> processorBuilderCls) |
protected void |
overwriteProcessorClass(Class<?> interfaceCls,
Class<?> processorCls) |
protected abstract void |
prepareInterpreter()
Prepares the interpreter.
|
void |
reload(List<KnowledgeBaseScript> scripts) |
createPluginInstance, createProcessorInstance, getCustomRuleEventSpec, getEngineOperations, getLogger, getRuleEventSpec, getSpecificExceptionMessage, getType, getVariable, resolveEventNameAndAliasclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waiteval, invokeFunction, invokeOptionalFunction, scanToAutoEnablecreatePluginInstance, createProcessorInstance, getEngineOperations, getJavaException, getRuleEventSpec, getScriptKnowledgeBaseProcessorClassName, getSpecificExceptionMessage, getType, getVariable, getVariable, hasVariable, invokeMethod, isKnowledgeBaseException, setVariableonClearpublic static final String PROP_PATH_SEPARATOR
protected Object interpteterSynchro
protected ScriptClassInstanceProvider scriptClassInstancePovider
protected BaseScriptKnowledgeBaseInterpreter(KnowledgeBaseEngineOperations engineOperations, KnowledgeBaseType type)
engineOperations - an engine operations.type - a knowledge base type.protected abstract void prepareInterpreter()
protected abstract <T> ScriptClassInstanceProvider<T> createScriptClassInstancePovider()
protected <T> T doCreateInstance(String className, Class<T> javaClass)
BaseKnowledgeBaseInterpreterdoCreateInstance in class BaseKnowledgeBaseInterpreterT - instance typeclassName - class name.javaClass - processor class.protected final void invalidateCache()
public final void load(List<KnowledgeBaseScript> scripts)
load in interface ScriptKnowledgeBaseInterpreterpublic final void load(String filename)
load in interface ScriptKnowledgeBaseInterpreterfilename - filename.public final void load(String filename, String charset)
load in interface ScriptKnowledgeBaseInterpreterfilename - filename.charset - charset.public final void load(String filename, Charset charset)
load in interface ScriptKnowledgeBaseInterpreterpublic final void load(String filename, Charset charset, boolean required)
load in interface ScriptKnowledgeBaseInterpreterpublic final void load(KnowledgeBaseScript script)
load in interface ScriptKnowledgeBaseInterpreterpublic final void reload(List<KnowledgeBaseScript> scripts)
reload in interface ScriptKnowledgeBaseInterpreterprotected void doReload(List<KnowledgeBaseScript> scripts)
public void onInit()
onInit in interface KnowledgeBaseOperationspublic void onBeforeLoad()
onBeforeLoad in interface KnowledgeBaseOperationspublic void onLoad()
onLoad in interface KnowledgeBaseOperationspublic void onAfterLoad()
onAfterLoad in interface KnowledgeBaseOperationspublic void onStartup()
onStartup in interface KnowledgeBaseOperationspublic boolean onRun()
onRun in interface KnowledgeBaseOperationspublic void onShutdown()
onShutdown in interface KnowledgeBaseOperationspublic void onBeforeReload()
onBeforeReload in interface KnowledgeBaseOperationspublic void onAfterReload()
onAfterReload in interface KnowledgeBaseOperationspublic <T> T eval(String expression, Class<T> cls)
eval in interface ScriptKnowledgeBaseInterpreterprotected abstract ScriptKnowledgeBaseInterpreter createInterpreterInstance(SpongeEngine engine, KnowledgeBase knowledgeBase)
protected boolean isProcessorAbstract(String className)
public ProcessorInstanceHolder createProcessorInstanceByProcessorClass(KnowledgeBase knowledgeBase, Object processorClass, Class<?> javaClass)
createProcessorInstanceByProcessorClass in interface KnowledgeBaseInterpreterprotected void overwriteProcessorClass(Class<?> interfaceCls, Class<?> processorCls)
protected void overwriteProcessorBuilderClass(Class<?> interfaceCls, Class<?> processorBuilderCls)
Copyright © 2016–2020 Softelnet. All rights reserved.