Package org.drools.core.reteoo
Class WindowNode
java.lang.Object
org.drools.core.common.BaseNode
org.drools.core.reteoo.ObjectSource
org.drools.core.reteoo.WindowNode
- All Implemented Interfaces:
Serializable,NetworkNode,MemoryFactory<WindowNode.WindowMemory>,ObjectSink,ObjectSinkNode,RightTupleSink,Sink
public class WindowNode
extends ObjectSource
implements ObjectSinkNode, RightTupleSink, MemoryFactory<WindowNode.WindowMemory>
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.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.drools.core.reteoo.ObjectSource
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, sourceFields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId -
Constructor Summary
ConstructorsConstructorDescriptionWindowNode(int id, List<AlphaNodeFieldConstraint> constraints, List<BehaviorRuntime> behaviors, ObjectSource objectSource, BuildContext context) Construct aWindowNodewith a unique id using the provided list ofAlphaNodeFieldConstraintand the givenObjectSource. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertObject(InternalFactHandle factHandle, PropagationContext pctx, ReteEvaluator reteEvaluator) voidbyPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) org.drools.util.bitmask.BitMaskcalculateDeclaredMask(Pattern pattern, ObjectType modifiedType, List<String> settableProperties) createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator) Creates the WindowNode's memory.voiddoAttach(BuildContext context) booleanReturns the list of behaviors for this window nodeReturns theFieldConstraintsReturns the next nodeReturns the previous nodeintgetType()voidmodifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) voidmodifyRightTuple(TupleImpl rightTuple, PropagationContext context, ReteEvaluator reteEvaluator) voidretractRightTuple(TupleImpl rightTuple, PropagationContext pctx, ReteEvaluator reteEvaluator) voidSets the next nodevoidsetPreviousObjectSinkNode(ObjectSinkNode previous) Sets the previous nodevoidsetRightInputOtnId(ObjectTypeNodeId rightInputOtnId) toString()voidupdateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory) Methods inherited from class org.drools.core.reteoo.ObjectSource
addObjectSink, doRemove, getDeclaredMask, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, getRuleBase, initDeclaredMask, isInUse, networkUpdated, removeObjectSink, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMaskMethods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setStreamModeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.core.common.MemoryFactory
getMemoryIdMethods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminalMethods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
Field Details
-
behavior
-
-
Constructor Details
-
WindowNode
public WindowNode() -
WindowNode
public WindowNode(int id, List<AlphaNodeFieldConstraint> constraints, List<BehaviorRuntime> behaviors, ObjectSource objectSource, BuildContext context) Construct aWindowNodewith a unique id using the provided list ofAlphaNodeFieldConstraintand the givenObjectSource.- Parameters:
id- Node's IDconstraints- Node's constraintsbehaviors- list of behaviors for this window nodeobjectSource- Node's object source
-
-
Method Details
-
getType
public int getType()- Specified by:
getTypein interfaceNetworkNode
-
getConstraints
Returns theFieldConstraints- Returns:
FieldConstraints
-
getBehaviors
Returns the list of behaviors for this window node -
doAttach
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext pctx, ReteEvaluator reteEvaluator) - Specified by:
assertObjectin interfaceObjectSink
-
retractRightTuple
public void retractRightTuple(TupleImpl rightTuple, PropagationContext pctx, ReteEvaluator reteEvaluator) - Specified by:
retractRightTuplein interfaceRightTupleSink
-
modifyRightTuple
public void modifyRightTuple(TupleImpl rightTuple, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
modifyRightTuplein interfaceRightTupleSink
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
modifyObjectin interfaceObjectSink
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
byPassModifyToBetaNodein interfaceObjectSink
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory) - Specified by:
updateSinkin classObjectSource
-
createMemory
public WindowNode.WindowMemory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator) Creates the WindowNode's memory.- Specified by:
createMemoryin interfaceMemoryFactory<WindowNode.WindowMemory>
-
toString
-
equals
-
getNextObjectSinkNode
Returns the next node- Specified by:
getNextObjectSinkNodein interfaceObjectSinkNode- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
Sets the next node- Specified by:
setNextObjectSinkNodein interfaceObjectSinkNode- Parameters:
next- The next ObjectSinkNode
-
getPreviousObjectSinkNode
Returns the previous node- Specified by:
getPreviousObjectSinkNodein interfaceObjectSinkNode- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
Sets the previous node- Specified by:
setPreviousObjectSinkNodein interfaceObjectSinkNode- Parameters:
previous- The previous ObjectSinkNode
-
getEntryPoint
-
calculateDeclaredMask
public org.drools.util.bitmask.BitMask calculateDeclaredMask(Pattern pattern, ObjectType modifiedType, List<String> settableProperties) - Specified by:
calculateDeclaredMaskin classObjectSource
-
getRightInputOtnId
- Specified by:
getRightInputOtnIdin interfaceRightTupleSink
-
setRightInputOtnId
-