Package org.drools.core.impl
Class KnowledgeBaseImpl
java.lang.Object
org.drools.core.impl.KnowledgeBaseImpl
- All Implemented Interfaces:
RuleBase,InternalRuleBase
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected Map<String,InternalKnowledgePackage> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPackage(KiePackage newPkg) voidaddPackages(Collection<? extends KiePackage> newPkgs) Add aPackageto the network.voidaddProcess(Process process) voidvoidaddRules(Collection<RuleImpl> rules) voidafterIncrementalUpdate(KieBaseUpdate kieBaseUpdate) voidbeforeIncrementalUpdate(KieBaseUpdate kieBaseUpdate) createSegmentFromPrototype(ReteEvaluator reteEvaluator, LeftTupleSource tupleSource) createSegmentFromPrototype(ReteEvaluator reteEvaluator, SegmentMemory.SegmentPrototype proto) voidgetExactTypeDeclaration(Class<?> clazz) getFactType(String packageName, String typeName) getId()getKiePackage(String packageName) intintgetOrCreateExactTypeDeclaration(Class<?> clazz) getPackage(String name) intgetProcess(String id) getRete()Retrieve the Rete-OO network for thisRuleBase.getSegmentPrototype(SegmentMemory segment) getTypeDeclaration(Class<?> clazz) booleanbooleanbooleanhasUnits()voidinvalidateSegmentPrototype(LeftTupleNode rootNode) booleanvoidkBaseInternal_addPackages(Collection<InternalKnowledgePackage> clonedPkgs, Collection<InternalWorkingMemory> workingMemories) voidkBaseInternal_addProcess(Process process) voidkBaseInternal_addRules(Collection<? extends Rule> rules, Collection<InternalWorkingMemory> wms) voidvoidkBaseInternal_removeFunction(InternalKnowledgePackage pkg, String functionName) voidkBaseInternal_removePackage(InternalKnowledgePackage pkg, Collection<InternalWorkingMemory> workingMemories) voidkBaseInternal_removeProcess(String id, Process process) voidkBaseInternal_removeRule(InternalKnowledgePackage pkg, RuleImpl rule, Collection<InternalWorkingMemory> workingMemories) voidkBaseInternal_removeRules(Collection<? extends Rule> rules, Collection<InternalWorkingMemory> workingMemories) booleanvoidvoidvoidnewFactHandleFactory(long id, long counter) voidprotected voidprocessTypeDeclaration(TypeDeclaration newDecl, InternalKnowledgePackage newPkg) voidreadLock()voidvoidClass<?>registerAndLoadTypeDefinition(String className, byte[] def) static voidregisterFunctionClassAndInnerClasses(String functionClassName, JavaDialectRuntimeData runtime, KnowledgeBaseImpl.ClassRegister consumer) voidvoidregisterSegmentPrototype(LeftTupleNode tupleSource, SegmentMemory.SegmentPrototype smem) voidregisterTypeDeclaration(TypeDeclaration newDecl, InternalKnowledgePackage newPkg) voidremoveFunction(String packageName, String functionName) voidremoveGlobal(String identifier) voidremoveKiePackage(String packageName) booleanremoveObjectsGeneratedFromResource(Resource resource, Collection<InternalWorkingMemory> workingMemories) voidremoveProcess(String id) voidremoveQuery(String packageName, String ruleName) voidremoveRule(String packageName, String ruleName) voidremoveRules(Collection<RuleImpl> rules) voidsetContainerId(String containerId) voidsetResolvedReleaseId(ReleaseId currentReleaseId) protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.drools.core.impl.InternalRuleBase
getWorkingMemoryCounter
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
pkgs
-
jaxbClasses
-
-
Constructor Details
-
KnowledgeBaseImpl
public KnowledgeBaseImpl() -
KnowledgeBaseImpl
-
-
Method Details
-
getSessionConfiguration
- Specified by:
getSessionConfigurationin interfaceInternalRuleBase
-
removeKiePackage
- Specified by:
removeKiePackagein interfaceInternalRuleBase
-
kBaseInternal_removePackage
public void kBaseInternal_removePackage(InternalKnowledgePackage pkg, Collection<InternalWorkingMemory> workingMemories) -
getRule
- Specified by:
getRulein interfaceInternalRuleBase
-
getQuery
- Specified by:
getQueryin interfaceInternalRuleBase
-
getKiePackages
- Specified by:
getKiePackagesin interfaceInternalRuleBase
-
getKiePackage
- Specified by:
getKiePackagein interfaceInternalRuleBase
-
getId
-
newFactHandleFactory
- Specified by:
newFactHandleFactoryin interfaceInternalRuleBase
-
newFactHandleFactory
- Specified by:
newFactHandleFactoryin interfaceInternalRuleBase
-
getProcesses
- Specified by:
getProcessesin interfaceInternalRuleBase
-
getPackages
- Specified by:
getPackagesin interfaceRuleBase
-
getPackagesMap
- Specified by:
getPackagesMapin interfaceRuleBase
-
getGlobals
- Specified by:
getGlobalsin interfaceRuleBase
-
kBaseInternal_lock
public void kBaseInternal_lock() -
kBaseInternal_unlock
public void kBaseInternal_unlock() -
readLock
public void readLock()- Specified by:
readLockin interfaceInternalRuleBase
-
readUnlock
public void readUnlock()- Specified by:
readUnlockin interfaceInternalRuleBase
-
kBaseInternal_getLock
-
kBaseInternal_writeLock
public void kBaseInternal_writeLock() -
kBaseInternal_tryWriteLock
public boolean kBaseInternal_tryWriteLock() -
kBaseInternal_writeUnlock
public void kBaseInternal_writeUnlock() -
addPackages
Add aPackageto the network. Iterates through thePackageadding Each individualRuleto the network. Before update network each referencedWorkingMemoryis locked.- Specified by:
addPackagesin interfaceRuleBase- Parameters:
newPkgs- The package to add.
-
addPackage
- Specified by:
addPackagein interfaceRuleBase
-
kBaseInternal_addPackages
public void kBaseInternal_addPackages(Collection<InternalKnowledgePackage> clonedPkgs, Collection<InternalWorkingMemory> workingMemories) -
processAllTypesDeclaration
- Specified by:
processAllTypesDeclarationin interfaceInternalRuleBase
-
hasMultipleAgendaGroups
public boolean hasMultipleAgendaGroups()- Specified by:
hasMultipleAgendaGroupsin interfaceInternalRuleBase
-
registerFunctionClassAndInnerClasses
public static void registerFunctionClassAndInnerClasses(String functionClassName, JavaDialectRuntimeData runtime, KnowledgeBaseImpl.ClassRegister consumer) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
registerTypeDeclaration
- Specified by:
registerTypeDeclarationin interfaceInternalRuleBase
-
processTypeDeclaration
-
registerAndLoadTypeDefinition
public Class<?> registerAndLoadTypeDefinition(String className, byte[] def) throws ClassNotFoundException - Specified by:
registerAndLoadTypeDefinitionin interfaceInternalRuleBase- Throws:
ClassNotFoundException
-
addGlobal
- Specified by:
addGlobalin interfaceInternalRuleBase
-
removeGlobal
- Specified by:
removeGlobalin interfaceInternalRuleBase
-
setupRete
protected void setupRete() -
registerAddedEntryNodeCache
- Specified by:
registerAddedEntryNodeCachein interfaceInternalRuleBase
-
getAddedEntryNodeCache
- Specified by:
getAddedEntryNodeCachein interfaceInternalRuleBase
-
registeRremovedEntryNodeCache
- Specified by:
registeRremovedEntryNodeCachein interfaceInternalRuleBase
-
getRemovedEntryNodeCache
- Specified by:
getRemovedEntryNodeCachein interfaceInternalRuleBase
-
getRete
Retrieve the Rete-OO network for thisRuleBase.- Specified by:
getRetein interfaceInternalRuleBase- Returns:
- The RETE-OO network.
-
getReteooBuilder
- Specified by:
getReteooBuilderin interfaceInternalRuleBase
-
getNodeCount
public int getNodeCount()- Specified by:
getNodeCountin interfaceInternalRuleBase
-
getMemoryCount
public int getMemoryCount()- Specified by:
getMemoryCountin interfaceInternalRuleBase
-
hasSegmentPrototypes
public boolean hasSegmentPrototypes()- Specified by:
hasSegmentPrototypesin interfaceInternalRuleBase
-
registerSegmentPrototype
public void registerSegmentPrototype(LeftTupleNode tupleSource, SegmentMemory.SegmentPrototype smem) - Specified by:
registerSegmentPrototypein interfaceInternalRuleBase
-
invalidateSegmentPrototype
- Specified by:
invalidateSegmentPrototypein interfaceInternalRuleBase
-
getSegmentPrototype
- Specified by:
getSegmentPrototypein interfaceInternalRuleBase
-
createSegmentFromPrototype
public SegmentMemory createSegmentFromPrototype(ReteEvaluator reteEvaluator, LeftTupleSource tupleSource) - Specified by:
createSegmentFromPrototypein interfaceInternalRuleBase
-
createSegmentFromPrototype
public SegmentMemory createSegmentFromPrototype(ReteEvaluator reteEvaluator, SegmentMemory.SegmentPrototype proto) - Specified by:
createSegmentFromPrototypein interfaceInternalRuleBase
-
getSegmentPrototype
- Specified by:
getSegmentPrototypein interfaceInternalRuleBase
-
getExactTypeDeclaration
- Specified by:
getExactTypeDeclarationin interfaceInternalRuleBase
-
getOrCreateExactTypeDeclaration
- Specified by:
getOrCreateExactTypeDeclarationin interfaceInternalRuleBase- Specified by:
getOrCreateExactTypeDeclarationin interfaceRuleBase
-
getTypeDeclaration
- Specified by:
getTypeDeclarationin interfaceInternalRuleBase- Specified by:
getTypeDeclarationin interfaceRuleBase
-
getTypeDeclarations
- Specified by:
getTypeDeclarationsin interfaceInternalRuleBase
-
beforeIncrementalUpdate
- Specified by:
beforeIncrementalUpdatein interfaceInternalRuleBase
-
afterIncrementalUpdate
- Specified by:
afterIncrementalUpdatein interfaceInternalRuleBase
-
addRules
- Specified by:
addRulesin interfaceRuleBase- Throws:
InvalidPatternException
-
kBaseInternal_addRules
public void kBaseInternal_addRules(Collection<? extends Rule> rules, Collection<InternalWorkingMemory> wms) -
removeQuery
- Specified by:
removeQueryin interfaceInternalRuleBase
-
removeRules
- Specified by:
removeRulesin interfaceRuleBase
-
removeRule
- Specified by:
removeRulein interfaceInternalRuleBase
-
kBaseInternal_removeRule
public void kBaseInternal_removeRule(InternalKnowledgePackage pkg, RuleImpl rule, Collection<InternalWorkingMemory> workingMemories) -
kBaseInternal_removeRules
public void kBaseInternal_removeRules(Collection<? extends Rule> rules, Collection<InternalWorkingMemory> workingMemories) -
removeFunction
- Specified by:
removeFunctionin interfaceInternalRuleBase
-
kBaseInternal_removeFunction
-
addProcess
- Specified by:
addProcessin interfaceInternalRuleBase
-
kBaseInternal_addProcess
-
removeProcess
- Specified by:
removeProcessin interfaceInternalRuleBase
-
kBaseInternal_removeProcess
-
getProcess
- Specified by:
getProcessin interfaceInternalRuleBase
-
getPackage
- Specified by:
getPackagein interfaceRuleBase
-
getRuleBaseConfiguration
- Specified by:
getRuleBaseConfigurationin interfaceInternalRuleBase
-
getKieBaseConfiguration
- Specified by:
getKieBaseConfigurationin interfaceInternalRuleBase
-
getConfiguration
- Specified by:
getConfigurationin interfaceInternalRuleBase- Specified by:
getConfigurationin interfaceRuleBase
-
getRootClassLoader
- Specified by:
getRootClassLoaderin interfaceInternalRuleBase- Specified by:
getRootClassLoaderin interfaceRuleBase
-
executeQueuedActions
public void executeQueuedActions()- Specified by:
executeQueuedActionsin interfaceInternalRuleBase
-
createNewPartitionId
- Specified by:
createNewPartitionIdin interfaceInternalRuleBase
-
isPartitioned
public boolean isPartitioned()- Specified by:
isPartitionedin interfaceInternalRuleBase
-
getParallelEvaluationSlotsCount
public int getParallelEvaluationSlotsCount()- Specified by:
getParallelEvaluationSlotsCountin interfaceInternalRuleBase
-
getFactType
- Specified by:
getFactTypein interfaceInternalRuleBase
-
getClassFieldAccessorCache
- Specified by:
getClassFieldAccessorCachein interfaceInternalRuleBase
-
getEntryPointIds
- Specified by:
getEntryPointIdsin interfaceInternalRuleBase
-
removeObjectsGeneratedFromResource
public boolean removeObjectsGeneratedFromResource(Resource resource, Collection<InternalWorkingMemory> workingMemories) - Specified by:
removeObjectsGeneratedFromResourcein interfaceInternalRuleBase
-
getResolvedReleaseId
- Specified by:
getResolvedReleaseIdin interfaceInternalRuleBase
-
setResolvedReleaseId
- Specified by:
setResolvedReleaseIdin interfaceInternalRuleBase
-
getContainerId
- Specified by:
getContainerIdin interfaceRuleBase
-
setContainerId
- Specified by:
setContainerIdin interfaceRuleBase
-
getRuleUnitDescriptionRegistry
- Specified by:
getRuleUnitDescriptionRegistryin interfaceInternalRuleBase
-
hasUnits
public boolean hasUnits()- Specified by:
hasUnitsin interfaceInternalRuleBase
-
getReceiveNodes
- Specified by:
getReceiveNodesin interfaceInternalRuleBase
-
addReceiveNode
- Specified by:
addReceiveNodein interfaceInternalRuleBase
-