Package org.jboss.cache.aop.test.propagation

Examples of org.jboss.cache.aop.test.propagation.StateItem


      this.rootNode_ = new NodeImpl();
      rootNode_.setNodeFDN(rdn);
      rootNode_.setNodeRDN(rdn);
      rootNode_.setPropagationRule(orRule_);

      StateItem summary = new StateItemImpl(0);
      summary.setState(PropagationRule.STATE_CLEAR);
      rootNode_.setSummaryStateItem(summary);

      registMap(rootNode_);
   }
View Full Code Here


         node.setPropagationRule(orRule_);

         node.setParentNode(parent);
         parent.addChildNode(node);

         StateItem summary = new StateItemImpl(0);
         summary.setState(PropagationRule.STATE_CLEAR);
         node.setSummaryStateItem(summary);

         registMap(node);

         PropagationRule rule = node.getPropagationRule();
View Full Code Here

   }

   public void addStateItem(String parentFdn, long itemId, long defaultState) {
      Node node = findNode(parentFdn);
      if (node != null) {
         StateItem item = new StateItemImpl(itemId);
         item.setState(defaultState);

         node.addStateItem(item);

         PropagationRule rule = node.getPropagationRule();
         rule.summaryUpperPropagate(node);
View Full Code Here

      String itemPrefix = prefix + " | ";
      List items = node.getStateItems();
      int size = items.size();
      for (int idx = 0; idx < size; idx++) {
         StateItem item = (StateItem) items.get(idx);
         printStateItem(item, itemPrefix);
      }

      String childPrefix = prefix + " + ";
      List children = node.getChildren();
View Full Code Here

      String itemPrefix = prefix + " | ";
      List items = node.getStateItems();
      int size = items.size();
      for (int idx = 0; idx < size; idx++) {
         StateItem item = (StateItem) items.get(idx);
         buf.append(toStateItemString(item, itemPrefix));
      }

      String childPrefix = prefix + " + ";
      List children = node.getChildren();
View Full Code Here

   public List getStateItems() {
      return this.stateItems_;
   }

   public StateItem findStateItem(long itemId) {
      StateItem retItem = null;
      int size = stateItems_.size();
      for (int idx = 0; idx < size; idx++) {
         StateItem stateItem = (StateItem) stateItems_.get(idx);
         if (stateItem.getItemId() == itemId) {
            retItem = stateItem;
            break;
         }
      }
View Full Code Here

      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);
      }
   }
View Full Code Here

import org.jboss.cache.aop.test.propagation.PropagationRule;
import org.jboss.cache.aop.test.propagation.StateItem;

public abstract class AbstractPropagtionRule implements PropagationRule {
   public void changeState(Node node, long itemId, long state) {
      StateItem target = node.findStateItem(itemId);
      if (target == null) {
         System.out.println("[Error] StateItem not found. : " + node + ":"
                 + itemId);
         return;
      }

      if (StateItem.STATE_CHANGED == target.setState(state)) {
         summaryUpperPropagate(node);
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.aop.test.propagation.StateItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.