Package org.drools.core.reteoo
Class ObjectSource
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.ObjectSource
-
- All Implemented Interfaces:
NetworkNode
- Direct Known Subclasses:
AlphaNode,EntryPointNode,ObjectTypeNode,Rete,RightInputAdapterNode,WindowNode
public abstract class ObjectSource extends BaseNode
A source ofFactHandles for anObjectSink.Nodes that propagate
FactHandleImplextend this class.- See Also:
ObjectSource,DefaultFactHandle
-
-
Field Summary
Fields Modifier and Type Field Description protected intalphaNodeHashingThresholdprotected intalphaNodeRangeIndexThresholdprotected BitMaskdeclaredMaskprotected BitMaskinferredMaskprotected ObjectSinkPropagatorsinkThe destination forFactHandleImpl.protected ObjectSourcesource-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Modifier Constructor Description ObjectSource()protectedObjectSource(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled)Single parameter constructor that specifies the unique id of the node.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddObjectSink(ObjectSink objectSink)Adds theObjectSinkso that it may receiveFactHandleImplpropagated from thisObjectSource.abstract BitMaskcalculateDeclaredMask(ObjectType modifiedType, java.util.List<java.lang.String> settableProperties)protected booleandoRemove(RuleRemovalContext context, ReteooBuilder builder)Removes the node from the network.BitMaskgetDeclaredMask()ObjectSinkPropagatorgetObjectSinkPropagator()ObjectTypeNodegetObjectTypeNode()ObjectSourcegetParentObjectSource()RuleBasegetRuleBase()voidinitDeclaredMask(BuildContext context)booleanisInUse()Returns true in case the current node is in use (is referenced by any other node)voidnetworkUpdated(UpdateContext updateContext)A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state updatevoidremoveObjectSink(ObjectSink objectSink)Removes theObjectSinkvoidresetInferredMask()voidsetObjectSinkPropagator(ObjectSinkPropagator sink)voidsetParentObjectSource(ObjectSource source)voidsetPartitionId(BuildContext context, RuleBasePartitionId partitionId)Sets the partition this node belongs tovoidsetPartitionIdWithSinks(RuleBasePartitionId partitionId)RuleBasePartitionIdsetSourcePartitionId(RuleBasePartitionId partitionId)BitMaskupdateMask(BitMask mask)abstract voidupdateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)-
Methods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, doAttach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setPartitionsEnabled, setStreamMode, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.NetworkNode
getType
-
-
-
-
Field Detail
-
sink
protected ObjectSinkPropagator sink
The destination forFactHandleImpl.
-
source
protected ObjectSource source
-
alphaNodeHashingThreshold
protected int alphaNodeHashingThreshold
-
alphaNodeRangeIndexThreshold
protected int alphaNodeRangeIndexThreshold
-
declaredMask
protected BitMask declaredMask
-
inferredMask
protected BitMask inferredMask
-
-
Constructor Detail
-
ObjectSource
public ObjectSource()
-
ObjectSource
protected ObjectSource(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled)Single parameter constructor that specifies the unique id of the node.
-
-
Method Detail
-
getParentObjectSource
public ObjectSource getParentObjectSource()
-
setParentObjectSource
public void setParentObjectSource(ObjectSource source)
-
getRuleBase
public RuleBase getRuleBase()
-
initDeclaredMask
public void initDeclaredMask(BuildContext context)
-
calculateDeclaredMask
public abstract BitMask calculateDeclaredMask(ObjectType modifiedType, java.util.List<java.lang.String> settableProperties)
-
resetInferredMask
public void resetInferredMask()
-
setPartitionId
public void setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
Description copied from class:BaseNodeSets the partition this node belongs to- Overrides:
setPartitionIdin classBaseNode
-
setSourcePartitionId
public final RuleBasePartitionId setSourcePartitionId(RuleBasePartitionId partitionId)
-
setPartitionIdWithSinks
public final void setPartitionIdWithSinks(RuleBasePartitionId partitionId)
-
addObjectSink
public void addObjectSink(ObjectSink objectSink)
Adds theObjectSinkso that it may receiveFactHandleImplpropagated from thisObjectSource.- Parameters:
objectSink- TheObjectSinkto receive propagatedFactHandleImpl.
-
removeObjectSink
public void removeObjectSink(ObjectSink objectSink)
Removes theObjectSink- Parameters:
objectSink- TheObjectSinkto remove
-
updateSink
public abstract void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
Description copied from class:BaseNodeA method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state update- Specified by:
networkUpdatedin classBaseNode
-
getObjectSinkPropagator
public ObjectSinkPropagator getObjectSinkPropagator()
-
setObjectSinkPropagator
public void setObjectSinkPropagator(ObjectSinkPropagator sink)
-
isInUse
public boolean isInUse()
Description copied from class:BaseNodeReturns true in case the current node is in use (is referenced by any other node)
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNodeRemoves the node from the network. Usually from the parentObjectSourceorTupleSource
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNodein classBaseNode
-
getDeclaredMask
public BitMask getDeclaredMask()
-
-