public class KnowledgeBaseImpl extends Object implements InternalKnowledgeBase, Externalizable
Modifier and Type | Class and Description |
---|---|
static interface |
KnowledgeBaseImpl.ClassRegister |
Modifier and Type | Field and Description |
---|---|
List<List<String>> |
jaxbClasses |
Set<org.kie.api.event.kiebase.KieBaseEventListener> |
kieBaseListeners |
protected static org.slf4j.Logger |
logger |
protected Map<String,InternalKnowledgePackage> |
pkgs |
Constructor and Description |
---|
KnowledgeBaseImpl() |
KnowledgeBaseImpl(String id,
RuleBaseConfiguration config) |
protected static final transient org.slf4j.Logger logger
protected Map<String,InternalKnowledgePackage> pkgs
public final Set<org.kie.api.event.kiebase.KieBaseEventListener> kieBaseListeners
public KnowledgeBaseImpl()
public KnowledgeBaseImpl(String id, RuleBaseConfiguration config)
public void initMBeans()
initMBeans
in interface InternalKnowledgeBase
public int nextWorkingMemoryCounter()
nextWorkingMemoryCounter
in interface InternalKnowledgeBase
public int getWorkingMemoryCounter()
getWorkingMemoryCounter
in interface InternalKnowledgeBase
public void addEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener)
addEventListener
in interface org.kie.api.event.kiebase.KieBaseEventManager
public void removeEventListener(org.kie.api.event.kiebase.KieBaseEventListener listener)
removeEventListener
in interface org.kie.api.event.kiebase.KieBaseEventManager
public Collection<org.kie.api.event.kiebase.KieBaseEventListener> getKieBaseEventListeners()
getKieBaseEventListeners
in interface org.kie.api.event.kiebase.KieBaseEventManager
public SessionConfiguration getSessionConfiguration()
getSessionConfiguration
in interface InternalKnowledgeBase
public void removeKiePackage(String packageName)
removeKiePackage
in interface org.kie.api.KieBase
public org.kie.api.definition.rule.Rule getRule(String packageName, String ruleName)
getRule
in interface org.kie.api.KieBase
public org.kie.api.definition.rule.Query getQuery(String packageName, String queryName)
getQuery
in interface org.kie.api.KieBase
public org.kie.api.runtime.KieSessionsPool newKieSessionsPool(int initialSize)
newKieSessionsPool
in interface org.kie.api.KieBase
public org.kie.api.runtime.KieSession newKieSession()
newKieSession
in interface org.kie.api.KieBase
public org.kie.api.runtime.KieSession newKieSession(org.kie.api.runtime.KieSessionConfiguration conf, org.kie.api.runtime.Environment environment)
newKieSession
in interface org.kie.api.KieBase
public StatefulKnowledgeSessionImpl createSession(long id, FactHandleFactory handleFactory, long propagationContext, SessionConfiguration config, InternalAgenda agenda, org.kie.api.runtime.Environment environment)
createSession
in interface InternalKnowledgeBase
public StatefulKnowledgeSessionImpl internalCreateStatefulKnowledgeSession(org.kie.api.runtime.Environment environment, SessionConfiguration sessionConfig, boolean fromPool)
public Collection<? extends org.kie.api.runtime.KieSession> getKieSessions()
getKieSessions
in interface org.kie.api.KieBase
public org.kie.api.runtime.StatelessKieSession newStatelessKieSession(org.kie.api.runtime.KieSessionConfiguration conf)
newStatelessKieSession
in interface org.kie.api.KieBase
public org.kie.api.runtime.StatelessKieSession newStatelessKieSession()
newStatelessKieSession
in interface org.kie.api.KieBase
public Collection<org.kie.api.definition.KiePackage> getKiePackages()
getKiePackages
in interface org.kie.api.KieBase
public org.kie.api.definition.KiePackage getKiePackage(String packageName)
getKiePackage
in interface org.kie.api.KieBase
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public String getId()
getId
in interface InternalKnowledgeBase
public void disposeStatefulSession(StatefulKnowledgeSessionImpl statefulSession)
disposeStatefulSession
in interface InternalKnowledgeBase
public FactHandleFactory newFactHandleFactory()
newFactHandleFactory
in interface InternalKnowledgeBase
public FactHandleFactory newFactHandleFactory(long id, long counter)
newFactHandleFactory
in interface InternalKnowledgeBase
public Collection<org.kie.api.definition.process.Process> getProcesses()
getProcesses
in interface org.kie.api.KieBase
public InternalKnowledgePackage[] getPackages()
public Map<String,InternalKnowledgePackage> getPackagesMap()
getPackagesMap
in interface InternalKnowledgeBase
public Map<String,Class<?>> getGlobals()
getGlobals
in interface InternalKnowledgeBase
public void readLock()
readLock
in interface InternalKnowledgeBase
public void readUnlock()
readUnlock
in interface InternalKnowledgeBase
public void addPackages(Collection<? extends org.kie.api.definition.KiePackage> newPkgs)
Package
to the network. Iterates through the
Package
adding Each individual Rule
to the
network. Before update network each referenced WorkingMemory
is locked.addPackages
in interface InternalKnowledgeBase
newPkgs
- The package to add.public Future<org.kie.api.definition.KiePackage> addPackage(org.kie.api.definition.KiePackage newPkg)
addPackage
in interface InternalKnowledgeBase
public void enqueueModification(Runnable modification)
enqueueModification
in interface InternalKnowledgeBase
public boolean flushModifications()
flushModifications
in interface InternalKnowledgeBase
public void processAllTypesDeclaration(Collection<InternalKnowledgePackage> pkgs)
processAllTypesDeclaration
in interface InternalKnowledgeBase
public static void registerFunctionClassAndInnerClasses(String functionClassName, JavaDialectRuntimeData runtime, KnowledgeBaseImpl.ClassRegister consumer) throws ClassNotFoundException
ClassNotFoundException
public void registerTypeDeclaration(TypeDeclaration newDecl, InternalKnowledgePackage newPkg)
registerTypeDeclaration
in interface InternalKnowledgeBase
protected void processTypeDeclaration(TypeDeclaration newDecl, InternalKnowledgePackage newPkg) throws ClassNotFoundException
ClassNotFoundException
public Class<?> registerAndLoadTypeDefinition(String className, byte[] def) throws ClassNotFoundException
registerAndLoadTypeDefinition
in interface InternalKnowledgeBase
ClassNotFoundException
public void addGlobal(String identifier, Class clazz)
addGlobal
in interface InternalKnowledgeBase
public void removeGlobal(String identifier)
removeGlobal
in interface InternalKnowledgeBase
protected void setupRete()
public void registerAddedEntryNodeCache(EntryPointNode node)
registerAddedEntryNodeCache
in interface InternalKnowledgeBase
public Set<EntryPointNode> getAddedEntryNodeCache()
getAddedEntryNodeCache
in interface InternalKnowledgeBase
public void registeRremovedEntryNodeCache(EntryPointNode node)
registeRremovedEntryNodeCache
in interface InternalKnowledgeBase
public Set<EntryPointNode> getRemovedEntryNodeCache()
getRemovedEntryNodeCache
in interface InternalKnowledgeBase
public Rete getRete()
RuleBase
.getRete
in interface InternalKnowledgeBase
public ReteooBuilder getReteooBuilder()
getReteooBuilder
in interface InternalKnowledgeBase
public int getNodeCount()
getNodeCount
in interface InternalKnowledgeBase
public int getMemoryCount(String topic)
getMemoryCount
in interface InternalKnowledgeBase
public void registerSegmentPrototype(LeftTupleSource tupleSource, SegmentMemory smem)
public boolean hasSegmentPrototypes()
hasSegmentPrototypes
in interface InternalKnowledgeBase
public void invalidateSegmentPrototype(LeftTupleNode rootNode)
invalidateSegmentPrototype
in interface InternalKnowledgeBase
public SegmentMemory createSegmentFromPrototype(InternalWorkingMemory wm, LeftTupleSource tupleSource)
createSegmentFromPrototype
in interface InternalKnowledgeBase
public SegmentMemory.Prototype getSegmentPrototype(SegmentMemory segment)
getSegmentPrototype
in interface InternalKnowledgeBase
public TypeDeclaration getExactTypeDeclaration(Class<?> clazz)
getExactTypeDeclaration
in interface InternalKnowledgeBase
public TypeDeclaration getOrCreateExactTypeDeclaration(Class<?> clazz)
getOrCreateExactTypeDeclaration
in interface InternalKnowledgeBase
public TypeDeclaration getTypeDeclaration(Class<?> clazz)
getTypeDeclaration
in interface InternalKnowledgeBase
public Collection<TypeDeclaration> getTypeDeclarations()
getTypeDeclarations
in interface InternalKnowledgeBase
public void addRules(Collection<RuleImpl> rules) throws InvalidPatternException
addRules
in interface InternalKnowledgeBase
InvalidPatternException
public void removeQuery(String packageName, String ruleName)
removeQuery
in interface org.kie.api.KieBase
public void removeRule(String packageName, String ruleName)
removeRule
in interface org.kie.api.KieBase
public void removeRules(Collection<RuleImpl> rules)
removeRules
in interface InternalKnowledgeBase
public void removeFunction(String packageName, String functionName)
removeFunction
in interface org.kie.api.KieBase
public void addProcess(org.kie.api.definition.process.Process process)
addProcess
in interface InternalKnowledgeBase
public void removeProcess(String id)
removeProcess
in interface InternalKnowledgeBase
removeProcess
in interface org.kie.api.KieBase
public org.kie.api.definition.process.Process getProcess(String id)
getProcess
in interface org.kie.api.KieBase
public void addStatefulSession(StatefulKnowledgeSessionImpl wm)
public InternalKnowledgePackage getPackage(String name)
getPackage
in interface InternalKnowledgeBase
public Collection<InternalWorkingMemory> getWorkingMemories()
getWorkingMemories
in interface InternalKnowledgeBase
public RuleBaseConfiguration getConfiguration()
getConfiguration
in interface InternalKnowledgeBase
public ClassLoader getRootClassLoader()
getRootClassLoader
in interface InternalKnowledgeBase
public void executeQueuedActions()
executeQueuedActions
in interface InternalKnowledgeBase
public RuleBasePartitionId createNewPartitionId()
createNewPartitionId
in interface InternalKnowledgeBase
public org.kie.api.definition.type.FactType getFactType(String packageName, String typeName)
getFactType
in interface org.kie.api.KieBase
public ClassFieldAccessorCache getClassFieldAccessorCache()
getClassFieldAccessorCache
in interface InternalKnowledgeBase
public Set<String> getEntryPointIds()
getEntryPointIds
in interface org.kie.api.KieBase
public TripleStore getTripleStore()
getTripleStore
in interface InternalKnowledgeBase
public TraitRegistry getTraitRegistry()
getTraitRegistry
in interface InternalKnowledgeBase
public boolean removeObjectsGeneratedFromResource(org.kie.api.io.Resource resource)
removeObjectsGeneratedFromResource
in interface InternalKnowledgeBase
public org.kie.api.builder.ReleaseId getResolvedReleaseId()
getResolvedReleaseId
in interface InternalKnowledgeBase
public void setResolvedReleaseId(org.kie.api.builder.ReleaseId currentReleaseId)
setResolvedReleaseId
in interface InternalKnowledgeBase
public String getContainerId()
getContainerId
in interface InternalKnowledgeBase
public void setContainerId(String containerId)
setContainerId
in interface InternalKnowledgeBase
public void setKieContainer(InternalKieContainer kieContainer)
setKieContainer
in interface InternalKnowledgeBase
public InternalKieContainer getKieContainer()
public RuleUnitDescriptionRegistry getRuleUnitDescriptionRegistry()
getRuleUnitDescriptionRegistry
in interface InternalKnowledgeBase
public boolean hasUnits()
hasUnits
in interface InternalKnowledgeBase
public List<AsyncReceiveNode> getReceiveNodes()
getReceiveNodes
in interface InternalKnowledgeBase
public void addReceiveNode(AsyncReceiveNode node)
addReceiveNode
in interface InternalKnowledgeBase
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.