public abstract class BaseNode extends Object implements NetworkNode
Modifier and Type | Field and Description |
---|---|
protected Bag<org.kie.api.definition.rule.Rule> |
associations |
protected int |
hashcode |
protected int |
id |
protected int |
memoryId |
protected RuleBasePartitionId |
partitionId |
protected boolean |
partitionsEnabled |
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(BuildContext context,
org.kie.api.definition.rule.Rule rule) |
void |
addAssociation(org.kie.api.definition.rule.Rule rule)
Associates this node with the give rule
|
abstract void |
attach(BuildContext context)
Attaches the node into the network.
|
protected abstract boolean |
doRemove(RuleRemovalContext context,
ReteooBuilder builder)
Removes the node from the network.
|
org.kie.api.definition.rule.Rule[] |
getAssociatedRules() |
int |
getAssociatedRuleSize()
Returns the number of rules that are associated with this node,
regardless of how many times the node is associated with a single rule.
|
int |
getAssociationsSize()
Returns how many times this nodes has been associated.
|
int |
getAssociationsSize(org.kie.api.definition.rule.Rule rule) |
int |
getId()
Returns the unique id that represents the node in the Rete network
|
int |
getMemoryId() |
abstract ObjectTypeNode |
getObjectTypeNode() |
RuleBasePartitionId |
getPartitionId()
Returns the partition ID for which this node belongs to
|
Sink[] |
getSinks() |
int |
hashCode() |
protected void |
initMemoryId(BuildContext context) |
boolean |
isAssociatedWith(org.kie.api.definition.rule.Rule rule) |
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 opportunity
for state update
|
void |
readExternal(ObjectInput in) |
boolean |
remove(RuleRemovalContext context,
ReteooBuilder builder) |
boolean |
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(BuildContext context,
RuleBasePartitionId partitionId)
Sets the partition this node belongs to
|
void |
setPartitionsEnabled(boolean partitionsEnabled) |
protected void |
setStreamMode(boolean streamMode) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
getType
protected int id
protected int memoryId
protected RuleBasePartitionId partitionId
protected boolean partitionsEnabled
protected Bag<org.kie.api.definition.rule.Rule> associations
protected int hashcode
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 int getMemoryId()
protected void initMemoryId(BuildContext context)
public boolean isStreamMode()
protected void setStreamMode(boolean streamMode)
public abstract void attach(BuildContext context)
ObjectSource
or TupleSource
public abstract void networkUpdated(UpdateContext updateContext)
public boolean remove(RuleRemovalContext context, ReteooBuilder builder)
protected abstract boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
ObjectSource
or TupleSource
public abstract boolean isInUse()
public abstract ObjectTypeNode getObjectTypeNode()
public RuleBasePartitionId getPartitionId()
getPartitionId
in interface NetworkNode
public void setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
public void setPartitionsEnabled(boolean partitionsEnabled)
public void addAssociation(org.kie.api.definition.rule.Rule rule)
public void addAssociation(BuildContext context, org.kie.api.definition.rule.Rule rule)
public boolean removeAssociation(org.kie.api.definition.rule.Rule rule)
public int getAssociationsSize()
NetworkNode
getAssociationsSize
in interface NetworkNode
public org.kie.api.definition.rule.Rule[] getAssociatedRules()
public int getAssociatedRuleSize()
NetworkNode
getAssociatedRuleSize
in interface NetworkNode
public int getAssociationsSize(org.kie.api.definition.rule.Rule rule)
getAssociationsSize
in interface NetworkNode
public boolean isAssociatedWith(org.kie.api.definition.rule.Rule rule)
isAssociatedWith
in interface NetworkNode
public Sink[] getSinks()
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.