public abstract class BaseNode extends Object implements NetworkNode
Modifier and Type | Field and Description |
---|---|
protected Map<org.kie.api.definition.rule.Rule,RuleComponent> |
associations |
protected int |
id |
protected RuleBasePartitionId |
partitionId |
protected boolean |
partitionsEnabled |
protected boolean |
streamMode |
Constructor and Description |
---|
BaseNode() |
BaseNode(int id,
RuleBasePartitionId partitionId,
boolean partitionsEnabled)
All nodes have a unique id, set in the constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(org.kie.api.definition.rule.Rule rule,
RuleComponent component)
Creates an association between this node and the rule + rule component
that caused the creation of this node.
|
void |
attach() |
abstract void |
attach(BuildContext context)
Attaches the node into the network.
|
protected abstract void |
doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
Removes the node from teh network.
|
Map<org.kie.api.definition.rule.Rule,RuleComponent> |
getAssociations()
Returns the map of associations for this node
|
int |
getId()
Returns the unique id that represents the node in the Rete network
|
RuleBasePartitionId |
getPartitionId()
Returns the partition ID for which this node belongs to
|
int |
hashCode()
The hashCode return is simply the unique id of the node.
|
abstract boolean |
isInUse()
Returns true in case the current node is in use (is referenced by any other node)
|
boolean |
isStreamMode() |
abstract 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 oportunity
for state update
|
void |
readExternal(ObjectInput in) |
protected static void |
registerUnlinkedPaths(InternalWorkingMemory wm,
SegmentMemory smem,
boolean stagedDeleteWasEmpty) |
void |
remove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories) |
void |
removeAssociation(org.kie.api.definition.rule.Rule rule)
Removes the association to the given rule from the
associations map.
|
void |
setId(int id) |
void |
setPartitionId(RuleBasePartitionId partitionId)
Sets the partition this node belongs to
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
getType
protected int id
protected RuleBasePartitionId partitionId
protected boolean partitionsEnabled
protected Map<org.kie.api.definition.rule.Rule,RuleComponent> associations
protected boolean streamMode
public BaseNode()
public BaseNode(int id, RuleBasePartitionId partitionId, boolean partitionsEnabled)
id
- The unique idpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public int getId()
NetworkNode
getId
in interface NetworkNode
public void setId(int id)
public boolean isStreamMode()
public void attach()
public abstract void attach(BuildContext context)
ObjectSource
or TupleSource
public abstract void networkUpdated(UpdateContext updateContext)
public void remove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories)
protected abstract void doRemove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories)
ObjectSource
or TupleSource
builder
- public abstract boolean isInUse()
public int hashCode()
public RuleBasePartitionId getPartitionId()
getPartitionId
in interface NetworkNode
public void setPartitionId(RuleBasePartitionId partitionId)
partitionId
- public void addAssociation(org.kie.api.definition.rule.Rule rule, RuleComponent component)
rule
- The rule sourcecomponent
- public Map<org.kie.api.definition.rule.Rule,RuleComponent> getAssociations()
getAssociations
in interface NetworkNode
public void removeAssociation(org.kie.api.definition.rule.Rule rule)
rule
- protected static void registerUnlinkedPaths(InternalWorkingMemory wm, SegmentMemory smem, boolean stagedDeleteWasEmpty)
Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.