Package org.drools.core.common
Class AgendaGroupQueueImpl
- java.lang.Object
-
- org.drools.core.common.AgendaGroupQueueImpl
-
- All Implemented Interfaces:
InternalAgendaGroup
,InternalRuleFlowGroup
,RuleFlowGroup
,org.kie.api.runtime.rule.AgendaGroup
,org.kie.api.runtime.rule.RuleFlowGroup
public class AgendaGroupQueueImpl extends java.lang.Object implements InternalAgendaGroup, InternalRuleFlowGroup
AgendaGroup
implementation that uses aPriorityQueue
to prioritise the evaluation of addedActivationQueue
s. TheAgendaGroup
also maintains aMap
ofActivationQueues
for requested salience values.- See Also:
PriorityQueue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AgendaGroupQueueImpl.ClearAction
static class
AgendaGroupQueueImpl.DeactivateCallback
class
AgendaGroupQueueImpl.SetFocusAction
-
Constructor Summary
Constructors Constructor Description AgendaGroupQueueImpl(java.lang.String name, InternalRuleBase kBase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RuleAgendaItem activation)
void
addNodeInstance(java.lang.Object processInstanceId, java.lang.String nodeInstanceId)
void
clear()
boolean
equals(java.lang.Object object)
long
getActivatedForRecency()
java.util.Collection<RuleAgendaItem>
getActivations()
java.util.Collection<RuleAgendaItem>
getAll()
PropagationContext
getAutoFocusActivator()
long
getClearedForRecency()
java.lang.String
getName()
java.util.Map<java.lang.Object,java.lang.String>
getNodeInstances()
int
hashCode()
void
hasRuleFlowListener(boolean hasRuleFlowLister)
boolean
isActive()
boolean
isAutoDeactivate()
boolean
isEmpty()
boolean
isRuleFlowListener()
boolean
isSequential()
RuleAgendaItem
peek()
RuleAgendaItem
remove()
void
remove(RuleAgendaItem activation)
void
removeNodeInstance(java.lang.Object processInstanceId, java.lang.String nodeInstanceId)
void
reset()
void
setActivatedForRecency(long recency)
void
setActive(boolean activate)
void
setAutoDeactivate(boolean autoDeactivate)
Sets the auto-deactivate status of this RuleFlowGroup.void
setAutoFocusActivator(PropagationContext autoFocusActivator)
void
setClearedForRecency(long recency)
void
setFocus()
void
setReteEvaluator(ReteEvaluator reteEvaluator)
int
size()
java.lang.String
toString()
void
visited()
-
-
-
Constructor Detail
-
AgendaGroupQueueImpl
public AgendaGroupQueueImpl(java.lang.String name, InternalRuleBase kBase)
-
-
Method Detail
-
visited
public void visited()
- Specified by:
visited
in interfaceInternalAgendaGroup
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceorg.kie.api.runtime.rule.AgendaGroup
- Specified by:
getName
in interfaceRuleFlowGroup
- Specified by:
getName
in interfaceorg.kie.api.runtime.rule.RuleFlowGroup
-
setReteEvaluator
public void setReteEvaluator(ReteEvaluator reteEvaluator)
- Specified by:
setReteEvaluator
in interfaceInternalAgendaGroup
-
hasRuleFlowListener
public void hasRuleFlowListener(boolean hasRuleFlowLister)
- Specified by:
hasRuleFlowListener
in interfaceInternalAgendaGroup
-
isRuleFlowListener
public boolean isRuleFlowListener()
- Specified by:
isRuleFlowListener
in interfaceInternalAgendaGroup
-
clear
public void clear()
- Specified by:
clear
in interfaceorg.kie.api.runtime.rule.AgendaGroup
- Specified by:
clear
in interfaceorg.kie.api.runtime.rule.RuleFlowGroup
-
setFocus
public void setFocus()
- Specified by:
setFocus
in interfaceorg.kie.api.runtime.rule.AgendaGroup
-
reset
public void reset()
- Specified by:
reset
in interfaceInternalAgendaGroup
-
getAll
public java.util.Collection<RuleAgendaItem> getAll()
- Specified by:
getAll
in interfaceInternalAgendaGroup
-
size
public int size()
- Specified by:
size
in interfaceInternalAgendaGroup
- Specified by:
size
in interfaceRuleFlowGroup
- Returns:
- The int total number of activations
-
add
public void add(RuleAgendaItem activation)
- Specified by:
add
in interfaceInternalAgendaGroup
-
remove
public RuleAgendaItem remove()
- Specified by:
remove
in interfaceInternalAgendaGroup
-
peek
public RuleAgendaItem peek()
- Specified by:
peek
in interfaceInternalAgendaGroup
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceInternalAgendaGroup
- Specified by:
isActive
in interfaceRuleFlowGroup
- Returns:
- boolean value indicating if the AgendaGroup is active and thus being evaluated.
-
isAutoDeactivate
public boolean isAutoDeactivate()
- Specified by:
isAutoDeactivate
in interfaceInternalAgendaGroup
- Specified by:
isAutoDeactivate
in interfaceRuleFlowGroup
-
setAutoDeactivate
public void setAutoDeactivate(boolean autoDeactivate)
Description copied from interface:InternalAgendaGroup
Sets the auto-deactivate status of this RuleFlowGroup. If this is set to true, an active RuleFlowGroup automatically deactivates if it has no more activations. If it had no activations when it was activated, it will be deactivated immediately.- Specified by:
setAutoDeactivate
in interfaceInternalAgendaGroup
- Specified by:
setAutoDeactivate
in interfaceRuleFlowGroup
-
addNodeInstance
public void addNodeInstance(java.lang.Object processInstanceId, java.lang.String nodeInstanceId)
- Specified by:
addNodeInstance
in interfaceInternalAgendaGroup
-
removeNodeInstance
public void removeNodeInstance(java.lang.Object processInstanceId, java.lang.String nodeInstanceId)
- Specified by:
removeNodeInstance
in interfaceInternalAgendaGroup
-
setActive
public void setActive(boolean activate)
- Specified by:
setActive
in interfaceInternalAgendaGroup
-
getAutoFocusActivator
public PropagationContext getAutoFocusActivator()
- Specified by:
getAutoFocusActivator
in interfaceInternalAgendaGroup
-
setAutoFocusActivator
public void setAutoFocusActivator(PropagationContext autoFocusActivator)
- Specified by:
setAutoFocusActivator
in interfaceInternalAgendaGroup
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceInternalAgendaGroup
- Specified by:
isEmpty
in interfaceRuleFlowGroup
- Returns:
- boolean value indicating if this AgendaGroup is empty or not
-
getActivations
public java.util.Collection<RuleAgendaItem> getActivations()
- Specified by:
getActivations
in interfaceInternalAgendaGroup
-
getNodeInstances
public java.util.Map<java.lang.Object,java.lang.String> getNodeInstances()
- Specified by:
getNodeInstances
in interfaceInternalAgendaGroup
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
remove
public void remove(RuleAgendaItem activation)
- Specified by:
remove
in interfaceInternalAgendaGroup
-
getActivatedForRecency
public long getActivatedForRecency()
- Specified by:
getActivatedForRecency
in interfaceInternalAgendaGroup
-
setActivatedForRecency
public void setActivatedForRecency(long recency)
- Specified by:
setActivatedForRecency
in interfaceInternalAgendaGroup
-
getClearedForRecency
public long getClearedForRecency()
- Specified by:
getClearedForRecency
in interfaceInternalAgendaGroup
-
setClearedForRecency
public void setClearedForRecency(long recency)
- Specified by:
setClearedForRecency
in interfaceInternalAgendaGroup
-
isSequential
public boolean isSequential()
- Specified by:
isSequential
in interfaceInternalAgendaGroup
-
-