[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/aop/test/propagation/impl ...

Manik Surtani msurtani at jboss.com
Fri Jul 21 16:07:55 EDT 2006


  User: msurtani
  Date: 06/07/21 16:07:55

  Added:       tests/functional/org/jboss/cache/aop/test/propagation/impl 
                        ORSummaryRule.java
  Log:
  Restored
  
  Revision  Changes    Path
  1.4       +0 -0      JBossCache/tests/functional/org/jboss/cache/aop/test/propagation/impl/ORSummaryRule.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ORSummaryRule.java
  ===================================================================
  RCS file: ORSummaryRule.java
  diff -N ORSummaryRule.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ ORSummaryRule.java	21 Jul 2006 20:07:55 -0000	1.4
  @@ -0,0 +1,43 @@
  +package org.jboss.cache.aop.test.propagation.impl;
  +
  +import org.jboss.cache.aop.test.propagation.Node;
  +import org.jboss.cache.aop.test.propagation.StateItem;
  +
  +import java.util.List;
  +
  +public class ORSummaryRule extends AbstractPropagtionRule {
  +   private static final String RULE_NAME = "OR-Rule";
  +
  +   public void summaryUpperPropagate(Node node) {
  +      long maxSeverity = 0;
  +
  +      List stateItems = node.getStateItems();
  +      int size = stateItems.size();
  +      for (int idx = 0; idx < size; idx++) {
  +         StateItem stateItem = (StateItem) stateItems.get(idx);
  +
  +         maxSeverity = updateMaxSeverity(maxSeverity, stateItem);
  +      }
  +
  +      List childNodes = node.getChildren();
  +      size = childNodes.size();
  +      for (int idx = 0; idx < size; idx++) {
  +         Node child = (Node) childNodes.get(idx);
  +         StateItem childSummary = child.getSummaryStateItem();
  +
  +         maxSeverity = updateMaxSeverity(maxSeverity, childSummary);
  +      }
  +
  +      long summaryState = STATE_CLEAR + maxSeverity;
  +      StateItem summaryItem = node.getSummaryStateItem();
  +      boolean isSummaryChanged = summaryItem.setState(summaryState);
  +
  +      if (StateItem.STATE_CHANGED == isSummaryChanged) {
  +         upperPropagate(node);
  +      }
  +   }
  +
  +   public String toString() {
  +      return RULE_NAME;
  +   }
  +}
  
  
  



More information about the jboss-cvs-commits mailing list