Package org.drools.core.common
Class ConcurrentNodeMemories
- java.lang.Object
-
- org.drools.core.common.ConcurrentNodeMemories
-
- All Implemented Interfaces:
NodeMemories
public class ConcurrentNodeMemories extends java.lang.Object implements NodeMemories
A concurrent implementation for the node memories interface
-
-
Constructor Summary
Constructors Constructor Description ConcurrentNodeMemories(InternalRuleBase ruleBase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
clearNodeMemory(MemoryFactory node)
Memory
getNodeMemory(MemoryFactory node, ReteEvaluator reteEvaluator)
The implementation tries to delay locking as much as possible, by running some potentially unsafe operations out of the critical session.int
length()
Returns the number of positions in this memoryMemory
peekNodeMemory(int memoryId)
Peeks at the content of the node memory for the given node ID.void
resetAllMemories(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(InternalRuleBase ruleBase)
-
-
Method Detail
-
clearNodeMemory
public void clearNodeMemory(MemoryFactory node)
- Specified by:
clearNodeMemory
in interfaceNodeMemories
-
clear
public void clear()
- Specified by:
clear
in interfaceNodeMemories
-
resetAllMemories
public void resetAllMemories(org.kie.internal.runtime.StatefulKnowledgeSession session)
- Specified by:
resetAllMemories
in interfaceNodeMemories
-
getNodeMemory
public Memory getNodeMemory(MemoryFactory node, ReteEvaluator reteEvaluator)
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:
getNodeMemory
in interfaceNodeMemories
-
peekNodeMemory
public Memory peekNodeMemory(int memoryId)
Description copied from interface:NodeMemories
Peeks 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:
peekNodeMemory
in interfaceNodeMemories
- Returns:
-
length
public int length()
Description copied from interface:NodeMemories
Returns the number of positions in this memory- Specified by:
length
in interfaceNodeMemories
- Returns:
-
-