示例#1
0
 @Override
 public synchronized Rule remove(String key) {
   Rule rule = super.remove(key);
   if (ruleEngine.removeRule(key)) {
     postEvent(RuleEventFactory.createRuleRemovedEvent(rule, SOURCE));
   }
   if (disabledRulesStorage != null) {
     disabledRulesStorage.remove(key);
   }
   return rule;
 }
示例#2
0
 @Override
 protected synchronized void removeProvider(Provider<Rule> provider) {
   Collection<Rule> rules = provider.getAll();
   for (Iterator<Rule> it = rules.iterator(); it.hasNext(); ) {
     Rule rule = it.next();
     String uid = rule.getUID();
     if (ruleEngine.removeRule(uid)) {
       postEvent(RuleEventFactory.createRuleRemovedEvent(rule, SOURCE));
     }
     if (disabledRulesStorage != null) {
       disabledRulesStorage.remove(uid);
     }
   }
   if (provider instanceof ManagedRuleProvider) {
     hasManagedRuleProvider = false;
   }
   super.removeProvider(provider);
 }