Package org.drools.core.reteoo
Class EntryPointNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.ObjectSource
-
- org.drools.core.reteoo.EntryPointNode
-
- All Implemented Interfaces:
java.io.Serializable
,org.drools.base.common.NetworkNode
,ObjectSink
,Sink
public class EntryPointNode extends ObjectSource implements ObjectSink
A node that is an entry point into the Rete network. As we move the design to support network partitions and concurrent processing of parts of the network, we also need to support multiple, independent entry points and this class represents that. It replaces the function of the Rete Node class in previous designs.- See Also:
ObjectTypeNode
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
log
protected java.util.Map<org.drools.base.base.ObjectType,ObjectTypeNode>
objectTypeNodes
The object type nodes under this nodeprotected ObjectTypeNode
queryNode
-
Fields inherited from class org.drools.core.reteoo.ObjectSource
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, source
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description EntryPointNode()
EntryPointNode(int id, org.drools.base.common.RuleBasePartitionId partitionId, boolean partitionsEnabled, ObjectSource objectSource, org.drools.base.rule.EntryPointId entryPoint)
EntryPointNode(int id, ObjectSource objectSource, BuildContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObjectSink(ObjectSink objectSink)
Adds theObjectSink
so that it may receiveObjects
propagated from thisObjectSource
.void
assertActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
void
assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
This is the entry point into the network for all asserted Facts.void
assertObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
void
attach()
void
byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
org.drools.core.util.bitmask.BitMask
calculateDeclaredMask(org.drools.base.base.ObjectType modifiedType, java.util.List<java.lang.String> settableProperties)
void
doAttach(BuildContext context)
protected boolean
doRemove(RuleRemovalContext context, ReteooBuilder builder)
Removes the node from the network.boolean
equals(java.lang.Object object)
org.drools.base.rule.EntryPointId
getEntryPoint()
java.util.Map<org.drools.base.base.ObjectType,ObjectTypeNode>
getObjectTypeNodes()
ObjectTypeNode
getQueryNode()
short
getType()
ObjectTypeConfigurationRegistry
getTypeConfReg()
void
modifyActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
void
modifyObject(InternalFactHandle handle, PropagationContext pctx, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
void
modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
void
propagateRetract(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
void
removeObjectSink(ObjectSink objectSink)
Removes theObjectSink
void
removeObjectType(org.drools.base.base.ObjectType objectType)
static void
removeRightTuplesMatchingOTN(PropagationContext pctx, ReteEvaluator reteEvaluator, ModifyPreviousTuples modifyPreviousTuples, ObjectTypeNode node, int partition)
void
retractActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
void
retractObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
Retract a fact object from thisRuleBase
and the specifiedWorkingMemory
.java.lang.String
toString()
void
updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
-
Methods inherited from class org.drools.core.reteoo.ObjectSource
getDeclaredMask, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, getRuleBase, initDeclaredMask, isInUse, networkUpdated, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMask
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setPartitionsEnabled, setStreamMode
-
-
-
-
Field Detail
-
log
protected static final transient org.slf4j.Logger log
-
objectTypeNodes
protected java.util.Map<org.drools.base.base.ObjectType,ObjectTypeNode> objectTypeNodes
The object type nodes under this node
-
queryNode
protected ObjectTypeNode queryNode
-
-
Constructor Detail
-
EntryPointNode
public EntryPointNode()
-
EntryPointNode
public EntryPointNode(int id, ObjectSource objectSource, BuildContext context)
-
EntryPointNode
public EntryPointNode(int id, org.drools.base.common.RuleBasePartitionId partitionId, boolean partitionsEnabled, ObjectSource objectSource, org.drools.base.rule.EntryPointId entryPoint)
-
-
Method Detail
-
getTypeConfReg
public ObjectTypeConfigurationRegistry getTypeConfReg()
-
getType
public short getType()
- Specified by:
getType
in interfaceorg.drools.base.common.NetworkNode
-
getEntryPoint
public org.drools.base.rule.EntryPointId getEntryPoint()
- Returns:
- the entryPoint
-
getQueryNode
public ObjectTypeNode getQueryNode()
-
assertActivation
public void assertActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
-
retractActivation
public void retractActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
-
modifyActivation
public void modifyActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
-
assertObject
public void assertObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
-
modifyObject
public void modifyObject(InternalFactHandle handle, PropagationContext pctx, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
-
removeRightTuplesMatchingOTN
public static void removeRightTuplesMatchingOTN(PropagationContext pctx, ReteEvaluator reteEvaluator, ModifyPreviousTuples modifyPreviousTuples, ObjectTypeNode node, int partition)
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
modifyObject
in interfaceObjectSink
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
This is the entry point into the network for all asserted Facts. Iterates a cache of matchingObjectTypdeNode
s asserting the Fact. If the cache does not exist it first iterates and builds the cache.- Specified by:
assertObject
in interfaceObjectSink
- Parameters:
factHandle
- The FactHandle of the fact to assertcontext
- ThePropagationContext
of theWorkingMemory
actionreteEvaluator
- The working memory session.
-
retractObject
public void retractObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
Retract a fact object from thisRuleBase
and the specifiedWorkingMemory
.- Parameters:
handle
- The handle of the fact to retract.reteEvaluator
- The working memory session.
-
propagateRetract
public void propagateRetract(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator)
-
addObjectSink
public void addObjectSink(ObjectSink objectSink)
Adds theObjectSink
so that it may receiveObjects
propagated from thisObjectSource
.- Overrides:
addObjectSink
in classObjectSource
- Parameters:
objectSink
- TheObjectSink
to receive propagatedObjects
. Rete only acceptsObjectTypeNode
s as parameters to this method, though.
-
removeObjectSink
public void removeObjectSink(ObjectSink objectSink)
Description copied from class:ObjectSource
Removes theObjectSink
- Overrides:
removeObjectSink
in classObjectSource
- Parameters:
objectSink
- TheObjectSink
to remove
-
removeObjectType
public void removeObjectType(org.drools.base.base.ObjectType objectType)
-
attach
public void attach()
-
doAttach
public void doAttach(BuildContext context)
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
- Overrides:
doRemove
in classObjectSource
-
getObjectTypeNodes
public java.util.Map<org.drools.base.base.ObjectType,ObjectTypeNode> getObjectTypeNodes()
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
- Specified by:
updateSink
in classObjectSource
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
byPassModifyToBetaNode
in interfaceObjectSink
-
calculateDeclaredMask
public org.drools.core.util.bitmask.BitMask calculateDeclaredMask(org.drools.base.base.ObjectType modifiedType, java.util.List<java.lang.String> settableProperties)
- Specified by:
calculateDeclaredMask
in classObjectSource
-
-