public class ObjectTypeNode extends ObjectSource implements ObjectSink, Externalizable, MemoryFactory<ObjectTypeNode.ObjectTypeNodeMemory>
ObjectTypeNodes are responsible for filtering and propagating the matching
fact assertions propagated from the Rete node using ObjectType interface.
The assert and retract methods do not attempt to filter as this is the role of the Rete
node which builds up a cache of matching ObjectTypdeNodess for each asserted object, using
the matches(Object object) method. Incorrect propagation in these methods is not checked and
will result in ClassCastExpcections later on in the network.
Filters Objects coming from the Rete using a
ObjectType semantic module.Rete,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
ObjectTypeNode.ExpireJob |
static class |
ObjectTypeNode.ExpireJobContext |
static class |
ObjectTypeNode.Id |
static class |
ObjectTypeNode.InitialFactObjectTypeNodeMemory |
static class |
ObjectTypeNode.ObjectTypeNodeMemory |
| Modifier and Type | Field and Description |
|---|---|
static ObjectTypeNode.Id |
DEFAULT_ID |
protected org.drools.core.reteoo.ObjectTypeNode.IdGenerator |
idGenerator |
protected ObjectType |
objectType
The
ObjectType semantic module. |
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, sourceassociations, hashcode, id, memoryId, partitionId, partitionsEnabled| Constructor and Description |
|---|
ObjectTypeNode() |
ObjectTypeNode(int id,
EntryPointNode source,
ObjectType objectType,
BuildContext context)
Construct given a semantic
ObjectType and the provided
unique id. |
| Modifier and Type | Method and Description |
|---|---|
void |
assertInitialFact(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
Propagate the
FactHandleimpl through the Rete network. |
void |
attach(BuildContext context)
Rete needs to know that this ObjectTypeNode has been added
|
void |
byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) |
BitMask |
calculateDeclaredMask(Class modifiedClass,
List<String> settableProperties) |
protected void |
checkDirty() |
ObjectTypeNode.ObjectTypeNodeMemory |
createMemory(RuleBaseConfiguration config,
InternalWorkingMemory wm)
Creates memory for the node using PrimitiveLongMap as its optimised for storage and reteivals of Longs.
|
protected boolean |
doRemove(RuleRemovalContext context,
ReteooBuilder builder)
OTN needs to override remove to avoid releasing the node ID, since OTN are
never removed from the rulebase in the current implementation
|
static void |
doRetractObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory) |
boolean |
equals(Object object) |
static void |
expireLeftTuple(LeftTuple leftTuple) |
static void |
expireRightTuple(RightTuple rightTuple) |
EntryPointId |
getEntryPoint() |
long |
getExpirationOffset() |
ObjectType |
getObjectType()
Retrieve the semantic
ObjectType differentiator. |
int |
getOtnIdCounter() |
RuleBasePartitionId |
getPartitionId()
Returns the partition ID for which this node belongs to
|
short |
getType() |
boolean |
isAssignableFrom(ObjectType objectType) |
boolean |
isObjectMemoryEnabled() |
void |
mergeExpirationOffset(ObjectTypeNode other) |
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) |
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
|
ObjectTypeNode.Id |
nextOtnId() |
void |
propagateAssert(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
readExternal(ObjectInput in) |
boolean |
remove(RuleRemovalContext context,
ReteooBuilder builder)
OTN needs to override remove to avoid releasing the node ID, since OTN are
never removed from the rulebase in the current implementation
|
protected void |
resetIdGenerator() |
static void |
retractLeftTuples(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory) |
static void |
retractLeftTuples(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory,
int partition) |
void |
retractObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
Retract the
FactHandleimpl from the Rete network. |
void |
retractObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory,
int partition) |
static void |
retractRightTuples(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory) |
static void |
retractRightTuples(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory,
int partition) |
void |
setExpirationOffset(long expirationOffset) |
void |
setObjectMemoryEnabled(boolean objectMemoryEnabled) |
String |
toString() |
void |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory) |
protected static void |
updateTupleSinkId(ObjectTypeNode otn,
ObjectSource source) |
void |
writeExternal(ObjectOutput out) |
addObjectSink, getDeclaredMask, getKnowledgeBase, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, initDeclaredMask, isInUse, removeObjectSink, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMaskaddAssociation, addAssociation, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, removeAssociation, setId, setPartitionsEnabled, setStreamModeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, isAssociatedWithgetMemoryIdprotected ObjectType objectType
ObjectType semantic module.protected transient org.drools.core.reteoo.ObjectTypeNode.IdGenerator idGenerator
public static final ObjectTypeNode.Id DEFAULT_ID
public ObjectTypeNode()
public ObjectTypeNode(int id,
EntryPointNode source,
ObjectType objectType,
BuildContext context)
ObjectType and the provided
unique id. All ObjectTypdeNode have node memory.id - The unique id for the node.objectType - The semantic object-type differentiator.public int getOtnIdCounter()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class ObjectSourceIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class ObjectSourceIOExceptionpublic short getType()
getType in interface NetworkNodepublic ObjectType getObjectType()
ObjectType differentiator.ObjectType differentiator.public RuleBasePartitionId getPartitionId()
getPartitionId in interface NetworkNodegetPartitionId in class BaseNodepublic BitMask calculateDeclaredMask(Class modifiedClass, List<String> settableProperties)
calculateDeclaredMask in class ObjectSourcepublic boolean isAssignableFrom(ObjectType objectType)
public void assertInitialFact(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
protected void checkDirty()
public void assertObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
FactHandleimpl through the Rete network. All
FactHandleImpl should be remembered in the node memory, so that later runtime rule attachmnents
can have the matched facts propagated to them.assertObject in interface ObjectSinkfactHandle - The fact handle.context - The propagation context.workingMemory - The working memory session.public void propagateAssert(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
public void retractObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
FactHandleimpl from the Rete network. Also remove the
FactHandleImpl from the node memory.factHandle - The fact handle.context - The propagation context.workingMemory - The working memory session.public void retractObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory, int partition)
public static void doRetractObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
public static void expireLeftTuple(LeftTuple leftTuple)
public static void expireRightTuple(RightTuple rightTuple)
public static void retractLeftTuples(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
public static void retractLeftTuples(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory, int partition)
public static void retractRightTuples(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
public static void retractRightTuples(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory, int partition)
protected void resetIdGenerator()
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
modifyObject in interface ObjectSinkpublic void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
updateSink in class ObjectSourcepublic void attach(BuildContext context)
public void networkUpdated(UpdateContext updateContext)
BaseNodenetworkUpdated in class ObjectSourceprotected static void updateTupleSinkId(ObjectTypeNode otn, ObjectSource source)
public ObjectTypeNode.Id nextOtnId()
public boolean remove(RuleRemovalContext context, ReteooBuilder builder)
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
doRemove in class ObjectSourcepublic ObjectTypeNode.ObjectTypeNodeMemory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
createMemory in interface MemoryFactory<ObjectTypeNode.ObjectTypeNodeMemory>public boolean isObjectMemoryEnabled()
public void setObjectMemoryEnabled(boolean objectMemoryEnabled)
public EntryPointId getEntryPoint()
public long getExpirationOffset()
public void setExpirationOffset(long expirationOffset)
public void mergeExpirationOffset(ObjectTypeNode other)
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
byPassModifyToBetaNode in interface ObjectSinkCopyright © 2001–2020 JBoss by Red Hat. All rights reserved.