Package org.drools.core.common
Class ConcurrentNodeMemories
- java.lang.Object
-
- org.drools.core.common.ConcurrentNodeMemories
-
- All Implemented Interfaces:
NodeMemories
public class ConcurrentNodeMemories extends Object implements NodeMemories
A concurrent implementation for the node memories interface
-
-
Constructor Summary
Constructors Constructor Description ConcurrentNodeMemories(InternalKnowledgeBase kBase, String unitName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclearNodeMemory(MemoryFactory node)MemorygetNodeMemory(MemoryFactory node, InternalWorkingMemory wm)The implementation tries to delay locking as much as possible, by running some potentially unsafe operations out of the critical session.intlength()Returns the number of positions in this memoryMemorypeekNodeMemory(int memoryId)Peeks at the content of the node memory for the given node ID.voidresetAllMemories(org.kie.internal.runtime.StatefulKnowledgeSession session)-
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.common.NodeMemories
peekNodeMemory
-
-
-
-
Constructor Detail
-
ConcurrentNodeMemories
public ConcurrentNodeMemories(InternalKnowledgeBase kBase, String unitName)
-
-
Method Detail
-
clearNodeMemory
public void clearNodeMemory(MemoryFactory node)
- Specified by:
clearNodeMemoryin interfaceNodeMemories
-
clear
public void clear()
- Specified by:
clearin interfaceNodeMemories
-
resetAllMemories
public void resetAllMemories(org.kie.internal.runtime.StatefulKnowledgeSession session)
- Specified by:
resetAllMemoriesin interfaceNodeMemories
-
getNodeMemory
public Memory getNodeMemory(MemoryFactory node, InternalWorkingMemory wm)
The implementation tries to delay locking as much as possible, by running some potentially unsafe operations out of the critical session. In case it fails the checks, it will move into the critical sessions and re-check everything before effectively doing any change on data structures.- Specified by:
getNodeMemoryin interfaceNodeMemories
-
peekNodeMemory
public Memory peekNodeMemory(int memoryId)
Description copied from interface:NodeMemoriesPeeks at the content of the node memory for the given node ID. This method has no side effects, so if the given memory slot for the given node ID is null, it will return null.- Specified by:
peekNodeMemoryin interfaceNodeMemories- Returns:
-
length
public int length()
Description copied from interface:NodeMemoriesReturns the number of positions in this memory- Specified by:
lengthin interfaceNodeMemories- Returns:
-
-