public class WindowNode extends ObjectSource implements ObjectSinkNode, RightTupleSink, MemoryFactory
WindowNodes
are nodes in the Rete
network used
to manage windows. They support multiple types of windows, like
sliding windows, tumbling windows, etc.
This class must act as a lock-gate for all working memory actions on it
and propagated down the network in this branch, as there can be concurrent
threads propagating events and expiring events working on this node at the
same time. It requires it to be thread safe.Modifier and Type | Class and Description |
---|---|
static class |
WindowNode.WindowMemory |
Modifier and Type | Field and Description |
---|---|
protected BehaviorManager |
behavior |
declaredMask, inferredMask, sink, source
associations, hashcode, id, partitionId, partitionsEnabled
Constructor and Description |
---|
WindowNode() |
WindowNode(int id,
List<AlphaNodeFieldConstraint> constraints,
List<Behavior> behaviors,
ObjectSource objectSource,
BuildContext context)
Construct a
WindowNode with a unique id using the provided
list of AlphaNodeFieldConstraint and the given ObjectSource . |
addObjectSink, doRemove, getDeclaredMask, getKnowledgeBase, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, initDeclaredMask, isInUse, networkUpdated, removeObjectSink, resetInferredMask, setParentObjectSource, updateMask
addAssociation, addAssociation, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, getSinks, hashCode, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionId, setStreamMode, thisNodeEquals
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, isAssociatedWith, thisNodeEquals
getId
protected BehaviorManager behavior
public WindowNode()
public WindowNode(int id, List<AlphaNodeFieldConstraint> constraints, List<Behavior> behaviors, ObjectSource objectSource, BuildContext context)
WindowNode
with a unique id using the provided
list of AlphaNodeFieldConstraint
and the given ObjectSource
.id
- Node's IDconstraints
- Node's constraintsbehaviors
- list of behaviors for this window nodeobjectSource
- Node's object sourcepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class ObjectSource
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class ObjectSource
IOException
public short getType()
getType
in interface NetworkNode
public void assertRightTuple(RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory)
assertRightTuple
in interface RightTupleSink
public List<AlphaNodeFieldConstraint> getConstraints()
FieldConstraints
FieldConstraints
public Behavior[] getBehaviors()
public void attach(BuildContext context)
BaseNode
ObjectSource
or TupleSource
public void assertObject(InternalFactHandle factHandle, PropagationContext pctx, InternalWorkingMemory workingMemory)
assertObject
in interface ObjectSink
public void retractRightTuple(RightTuple rightTuple, PropagationContext pctx, InternalWorkingMemory wm)
retractRightTuple
in interface RightTupleSink
public void modifyRightTuple(RightTuple rightTuple, PropagationContext context, InternalWorkingMemory workingMemory)
modifyRightTuple
in interface RightTupleSink
protected EntryPointNode getEntryPointNode()
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory wm)
modifyObject
in interface ObjectSink
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
byPassModifyToBetaNode
in interface ObjectSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory wm)
updateSink
in class ObjectSource
public Memory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
createMemory
in interface MemoryFactory
protected boolean internalEquals(Object object)
internalEquals
in class BaseNode
public ObjectSinkNode getNextObjectSinkNode()
getNextObjectSinkNode
in interface ObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
setNextObjectSinkNode
in interface ObjectSinkNode
next
- The next ObjectSinkNodepublic ObjectSinkNode getPreviousObjectSinkNode()
getPreviousObjectSinkNode
in interface ObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
setPreviousObjectSinkNode
in interface ObjectSinkNode
previous
- The previous ObjectSinkNodepublic EntryPointId getEntryPoint()
public BitMask calculateDeclaredMask(List<String> settableProperties)
calculateDeclaredMask
in class ObjectSource
public ObjectTypeNode.Id getRightInputOtnId()
getRightInputOtnId
in interface RightTupleSink
public void setRightInputOtnId(ObjectTypeNode.Id rightInputOtnId)
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.