Fixed RuleService concurrency around enable/disable at NodeRef level

- Done while rolling in ALF-10839: Eliminate rule discovery overhead on property update when rules have been disabled
 - Some checking of rule state done BEFORE walking up the node hierarchy
 - Also fixes ALF-4216: disabledRules List is not thread safe


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31255 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-10-16 20:16:52 +00:00
parent 68f462492e
commit 3cd0091162
13 changed files with 203 additions and 149 deletions

View File

@@ -59,7 +59,7 @@ public class CreateNodeRuleTrigger extends RuleTriggerAbstractBase
private boolean isClassBehaviour = false;
/** Runtime rule service */
RuntimeRuleService ruleService;
RuntimeRuleService runtimeRuleService;
/**
* Set whether this is a class behaviour or not
@@ -72,9 +72,9 @@ public class CreateNodeRuleTrigger extends RuleTriggerAbstractBase
/**
* Set the rule service
*/
public void setRuleService(RuntimeRuleService ruleService)
public void setRuntimeRuleService(RuntimeRuleService runtimeRuleService)
{
this.ruleService = ruleService;
this.runtimeRuleService = runtimeRuleService;
}
/**
@@ -113,6 +113,11 @@ public class CreateNodeRuleTrigger extends RuleTriggerAbstractBase
*/
public void onCreateNode(ChildAssociationRef childAssocRef)
{
// Break out early if rules are not enabled
if (!areRulesEnabled())
{
return;
}
NodeRef nodeRef = childAssocRef.getChildRef();
// Keep track of new nodes to prevent firing of updates in the same transaction
@@ -156,7 +161,7 @@ public class CreateNodeRuleTrigger extends RuleTriggerAbstractBase
}
// Removes any rules that have already been triggered for that node
ruleService.removeRulePendingExecution(nodeRef);
runtimeRuleService.removeRulePendingExecution(nodeRef);
}
/**