Package org.drools.core.impl
Class KnowledgeBaseImpl
- java.lang.Object
-
- org.drools.core.impl.KnowledgeBaseImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceKnowledgeBaseImpl.ClassRegister
-
Field Summary
Fields Modifier and Type Field Description List<List<String>>jaxbClassesprotected static org.slf4j.Loggerloggerprotected Map<String,InternalKnowledgePackage>pkgs
-
Constructor Summary
Constructors Constructor Description KnowledgeBaseImpl()KnowledgeBaseImpl(String id, RuleBaseConfiguration config)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.drools.core.impl.RuleBase
getWorkingMemoryCounter
-
-
-
-
Constructor Detail
-
KnowledgeBaseImpl
public KnowledgeBaseImpl()
-
KnowledgeBaseImpl
public KnowledgeBaseImpl(String id, RuleBaseConfiguration config)
-
-
Method Detail
-
getSessionConfiguration
public SessionConfiguration getSessionConfiguration()
- Specified by:
getSessionConfigurationin interfaceRuleBase
-
removeKiePackage
public void removeKiePackage(String packageName)
- Specified by:
removeKiePackagein interfaceRuleBase
-
kBaseInternal_removePackage
public void kBaseInternal_removePackage(InternalKnowledgePackage pkg, Collection<InternalWorkingMemory> workingMemories)
-
getKiePackages
public Collection<org.kie.api.definition.KiePackage> getKiePackages()
- Specified by:
getKiePackagesin interfaceRuleBase
-
getKiePackage
public org.kie.api.definition.KiePackage getKiePackage(String packageName)
- Specified by:
getKiePackagein interfaceRuleBase
-
newFactHandleFactory
public FactHandleFactory newFactHandleFactory()
- Specified by:
newFactHandleFactoryin interfaceRuleBase
-
newFactHandleFactory
public FactHandleFactory newFactHandleFactory(long id, long counter)
- Specified by:
newFactHandleFactoryin interfaceRuleBase
-
getProcesses
public Collection<org.kie.api.definition.process.Process> getProcesses()
- Specified by:
getProcessesin interfaceRuleBase
-
getPackages
public InternalKnowledgePackage[] getPackages()
- Specified by:
getPackagesin interfaceRuleBase
-
getPackagesMap
public Map<String,InternalKnowledgePackage> getPackagesMap()
- Specified by:
getPackagesMapin interfaceRuleBase
-
getGlobals
public Map<String,Class<?>> getGlobals()
- Specified by:
getGlobalsin interfaceRuleBase
-
kBaseInternal_lock
public void kBaseInternal_lock()
-
kBaseInternal_unlock
public void kBaseInternal_unlock()
-
readUnlock
public void readUnlock()
- Specified by:
readUnlockin interfaceRuleBase
-
kBaseInternal_getLock
public ReentrantReadWriteLock kBaseInternal_getLock()
-
kBaseInternal_writeLock
public void kBaseInternal_writeLock()
-
kBaseInternal_tryWriteLock
public boolean kBaseInternal_tryWriteLock()
-
kBaseInternal_writeUnlock
public void kBaseInternal_writeUnlock()
-
addPackages
public void addPackages(Collection<? extends org.kie.api.definition.KiePackage> newPkgs)
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
public Future<org.kie.api.definition.KiePackage> addPackage(org.kie.api.definition.KiePackage newPkg)
- Specified by:
addPackagein interfaceRuleBase
-
kBaseInternal_addPackages
public void kBaseInternal_addPackages(Collection<InternalKnowledgePackage> clonedPkgs, Collection<InternalWorkingMemory> workingMemories)
-
processAllTypesDeclaration
public void processAllTypesDeclaration(Collection<InternalKnowledgePackage> pkgs)
- Specified by:
processAllTypesDeclarationin interfaceRuleBase
-
hasMultipleAgendaGroups
public boolean hasMultipleAgendaGroups()
- Specified by:
hasMultipleAgendaGroupsin interfaceRuleBase
-
registerFunctionClassAndInnerClasses
public static void registerFunctionClassAndInnerClasses(String functionClassName, JavaDialectRuntimeData runtime, KnowledgeBaseImpl.ClassRegister consumer) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
registerTypeDeclaration
public void registerTypeDeclaration(TypeDeclaration newDecl, InternalKnowledgePackage newPkg)
- Specified by:
registerTypeDeclarationin interfaceRuleBase
-
processTypeDeclaration
protected void processTypeDeclaration(TypeDeclaration newDecl, InternalKnowledgePackage newPkg)
-
registerAndLoadTypeDefinition
public Class<?> registerAndLoadTypeDefinition(String className, byte[] def) throws ClassNotFoundException
- Specified by:
registerAndLoadTypeDefinitionin interfaceRuleBase- Throws:
ClassNotFoundException
-
removeGlobal
public void removeGlobal(String identifier)
- Specified by:
removeGlobalin interfaceRuleBase
-
setupRete
protected void setupRete()
-
registerAddedEntryNodeCache
public void registerAddedEntryNodeCache(EntryPointNode node)
- Specified by:
registerAddedEntryNodeCachein interfaceRuleBase
-
getAddedEntryNodeCache
public Set<EntryPointNode> getAddedEntryNodeCache()
- Specified by:
getAddedEntryNodeCachein interfaceRuleBase
-
registeRremovedEntryNodeCache
public void registeRremovedEntryNodeCache(EntryPointNode node)
- Specified by:
registeRremovedEntryNodeCachein interfaceRuleBase
-
getRemovedEntryNodeCache
public Set<EntryPointNode> getRemovedEntryNodeCache()
- Specified by:
getRemovedEntryNodeCachein interfaceRuleBase
-
getRete
public Rete getRete()
Retrieve the Rete-OO network for thisRuleBase.
-
getReteooBuilder
public ReteooBuilder getReteooBuilder()
- Specified by:
getReteooBuilderin interfaceRuleBase
-
getNodeCount
public int getNodeCount()
- Specified by:
getNodeCountin interfaceRuleBase
-
getMemoryCount
public int getMemoryCount()
- Specified by:
getMemoryCountin interfaceRuleBase
-
registerSegmentPrototype
public void registerSegmentPrototype(LeftTupleSource tupleSource, SegmentMemory smem)
- Specified by:
registerSegmentPrototypein interfaceRuleBase
-
hasSegmentPrototypes
public boolean hasSegmentPrototypes()
- Specified by:
hasSegmentPrototypesin interfaceRuleBase
-
invalidateSegmentPrototype
public void invalidateSegmentPrototype(LeftTupleNode rootNode)
- Specified by:
invalidateSegmentPrototypein interfaceRuleBase
-
createSegmentFromPrototype
public SegmentMemory createSegmentFromPrototype(ReteEvaluator reteEvaluator, LeftTupleSource tupleSource)
- Specified by:
createSegmentFromPrototypein interfaceRuleBase
-
getSegmentPrototype
public SegmentMemory.Prototype getSegmentPrototype(SegmentMemory segment)
- Specified by:
getSegmentPrototypein interfaceRuleBase
-
getExactTypeDeclaration
public TypeDeclaration getExactTypeDeclaration(Class<?> clazz)
- Specified by:
getExactTypeDeclarationin interfaceRuleBase
-
getOrCreateExactTypeDeclaration
public TypeDeclaration getOrCreateExactTypeDeclaration(Class<?> clazz)
- Specified by:
getOrCreateExactTypeDeclarationin interfaceRuleBase
-
getTypeDeclaration
public TypeDeclaration getTypeDeclaration(Class<?> clazz)
- Specified by:
getTypeDeclarationin interfaceRuleBase
-
getTypeDeclarations
public Collection<TypeDeclaration> getTypeDeclarations()
- Specified by:
getTypeDeclarationsin interfaceRuleBase
-
beforeIncrementalUpdate
public void beforeIncrementalUpdate(KieBaseUpdate kieBaseUpdate)
- Specified by:
beforeIncrementalUpdatein interfaceRuleBase
-
afterIncrementalUpdate
public void afterIncrementalUpdate(KieBaseUpdate kieBaseUpdate)
- Specified by:
afterIncrementalUpdatein interfaceRuleBase
-
addRules
public void addRules(Collection<RuleImpl> rules) throws InvalidPatternException
- Specified by:
addRulesin interfaceRuleBase- Throws:
InvalidPatternException
-
kBaseInternal_addRules
public void kBaseInternal_addRules(Collection<? extends org.kie.api.definition.rule.Rule> rules, Collection<InternalWorkingMemory> workingMemories)
-
removeQuery
public void removeQuery(String packageName, String ruleName)
- Specified by:
removeQueryin interfaceRuleBase
-
removeRules
public void removeRules(Collection<RuleImpl> rules)
- Specified by:
removeRulesin interfaceRuleBase
-
removeRule
public void removeRule(String packageName, String ruleName)
- Specified by:
removeRulein interfaceRuleBase
-
kBaseInternal_removeRule
public void kBaseInternal_removeRule(InternalKnowledgePackage pkg, RuleImpl rule, Collection<InternalWorkingMemory> workingMemories)
-
kBaseInternal_removeRules
public void kBaseInternal_removeRules(Collection<? extends org.kie.api.definition.rule.Rule> rules, Collection<InternalWorkingMemory> workingMemories)
-
removeFunction
public void removeFunction(String packageName, String functionName)
- Specified by:
removeFunctionin interfaceRuleBase
-
kBaseInternal_removeFunction
public void kBaseInternal_removeFunction(InternalKnowledgePackage pkg, String functionName)
-
addProcess
public void addProcess(org.kie.api.definition.process.Process process)
- Specified by:
addProcessin interfaceRuleBase
-
kBaseInternal_addProcess
public void kBaseInternal_addProcess(org.kie.api.definition.process.Process process)
-
removeProcess
public void removeProcess(String id)
- Specified by:
removeProcessin interfaceRuleBase
-
kBaseInternal_removeProcess
public void kBaseInternal_removeProcess(String id, org.kie.api.definition.process.Process process)
-
getProcess
public org.kie.api.definition.process.Process getProcess(String id)
- Specified by:
getProcessin interfaceRuleBase
-
getPackage
public InternalKnowledgePackage getPackage(String name)
- Specified by:
getPackagein interfaceRuleBase
-
getConfiguration
public RuleBaseConfiguration getConfiguration()
- Specified by:
getConfigurationin interfaceRuleBase
-
getRootClassLoader
public ClassLoader getRootClassLoader()
- Specified by:
getRootClassLoaderin interfaceRuleBase
-
executeQueuedActions
public void executeQueuedActions()
- Specified by:
executeQueuedActionsin interfaceRuleBase
-
createNewPartitionId
public RuleBasePartitionId createNewPartitionId()
- Specified by:
createNewPartitionIdin interfaceRuleBase
-
getFactType
public org.kie.api.definition.type.FactType getFactType(String packageName, String typeName)
- Specified by:
getFactTypein interfaceRuleBase
-
getClassFieldAccessorCache
public ClassFieldAccessorCache getClassFieldAccessorCache()
- Specified by:
getClassFieldAccessorCachein interfaceRuleBase
-
getEntryPointIds
public Set<String> getEntryPointIds()
- Specified by:
getEntryPointIdsin interfaceRuleBase
-
removeObjectsGeneratedFromResource
public boolean removeObjectsGeneratedFromResource(org.kie.api.io.Resource resource, Collection<InternalWorkingMemory> workingMemories)- Specified by:
removeObjectsGeneratedFromResourcein interfaceRuleBase
-
getResolvedReleaseId
public org.kie.api.builder.ReleaseId getResolvedReleaseId()
- Specified by:
getResolvedReleaseIdin interfaceRuleBase
-
setResolvedReleaseId
public void setResolvedReleaseId(org.kie.api.builder.ReleaseId currentReleaseId)
- Specified by:
setResolvedReleaseIdin interfaceRuleBase
-
getContainerId
public String getContainerId()
- Specified by:
getContainerIdin interfaceRuleBase
-
setContainerId
public void setContainerId(String containerId)
- Specified by:
setContainerIdin interfaceRuleBase
-
getRuleUnitDescriptionRegistry
public RuleUnitDescriptionRegistry getRuleUnitDescriptionRegistry()
- Specified by:
getRuleUnitDescriptionRegistryin interfaceRuleBase
-
getReceiveNodes
public List<AsyncReceiveNode> getReceiveNodes()
- Specified by:
getReceiveNodesin interfaceRuleBase
-
addReceiveNode
public void addReceiveNode(AsyncReceiveNode node)
- Specified by:
addReceiveNodein interfaceRuleBase
-
-