Package org.drools.core.reteoo
Class ObjectSource
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.ObjectSource
-
- All Implemented Interfaces:
Externalizable
,Serializable
,NetworkNode
- Direct Known Subclasses:
AlphaNode
,EntryPointNode
,ObjectTypeNode
,Rete
,RightInputAdapterNode
,WindowNode
public abstract class ObjectSource extends BaseNode implements Externalizable
A source ofFactHandle
s for anObjectSink
.Nodes that propagate
FactHandleImpl
extend this class.- See Also:
ObjectSource
,DefaultFactHandle
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
alphaNodeHashingThreshold
protected int
alphaNodeRangeIndexThreshold
protected BitMask
declaredMask
protected BitMask
inferredMask
protected ObjectSinkPropagator
sink
The destination forFactHandleImpl
.protected ObjectSource
source
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Modifier Constructor Description ObjectSource()
protected
ObjectSource(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 void
addObjectSink(ObjectSink objectSink)
Adds theObjectSink
so that it may receiveFactHandleImpl
propagated from thisObjectSource
.abstract BitMask
calculateDeclaredMask(Class modifiedClass, List<String> settableProperties)
protected boolean
doRemove(RuleRemovalContext context, ReteooBuilder builder)
Removes the node from the network.BitMask
getDeclaredMask()
InternalKnowledgeBase
getKnowledgeBase()
ObjectSinkPropagator
getObjectSinkPropagator()
ObjectTypeNode
getObjectTypeNode()
ObjectSource
getParentObjectSource()
void
initDeclaredMask(BuildContext context)
boolean
isInUse()
Returns true in case the current node is in use (is referenced by any other node)void
networkUpdated(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 updatevoid
readExternal(ObjectInput in)
void
removeObjectSink(ObjectSink objectSink)
Removes theObjectSink
void
resetInferredMask()
void
setObjectSinkPropagator(ObjectSinkPropagator sink)
void
setParentObjectSource(ObjectSource source)
void
setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
Sets the partition this node belongs tovoid
setPartitionIdWithSinks(RuleBasePartitionId partitionId)
RuleBasePartitionId
setSourcePartitionId(RuleBasePartitionId partitionId)
BitMask
updateMask(BitMask mask)
abstract void
updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
void
writeExternal(ObjectOutput out)
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, addAssociation, attach, doAttach, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, 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
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classBaseNode
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classBaseNode
- Throws:
IOException
-
getParentObjectSource
public ObjectSource getParentObjectSource()
-
setParentObjectSource
public void setParentObjectSource(ObjectSource source)
-
getKnowledgeBase
public InternalKnowledgeBase getKnowledgeBase()
-
initDeclaredMask
public void initDeclaredMask(BuildContext context)
-
calculateDeclaredMask
public abstract BitMask calculateDeclaredMask(Class modifiedClass, List<String> settableProperties)
-
resetInferredMask
public void resetInferredMask()
-
setPartitionId
public void setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
Description copied from class:BaseNode
Sets the partition this node belongs to- Overrides:
setPartitionId
in classBaseNode
-
setSourcePartitionId
public final RuleBasePartitionId setSourcePartitionId(RuleBasePartitionId partitionId)
-
setPartitionIdWithSinks
public final void setPartitionIdWithSinks(RuleBasePartitionId partitionId)
-
addObjectSink
public void addObjectSink(ObjectSink objectSink)
Adds theObjectSink
so that it may receiveFactHandleImpl
propagated from thisObjectSource
.- Parameters:
objectSink
- TheObjectSink
to receive propagatedFactHandleImpl
.
-
removeObjectSink
public void removeObjectSink(ObjectSink objectSink)
Removes theObjectSink
- Parameters:
objectSink
- TheObjectSink
to remove
-
updateSink
public abstract void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
Description copied from class:BaseNode
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 update- Specified by:
networkUpdated
in classBaseNode
-
getObjectSinkPropagator
public ObjectSinkPropagator getObjectSinkPropagator()
-
setObjectSinkPropagator
public void setObjectSinkPropagator(ObjectSinkPropagator sink)
-
isInUse
public boolean isInUse()
Description copied from class:BaseNode
Returns 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:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNode
in classBaseNode
-
getDeclaredMask
public BitMask getDeclaredMask()
-
-