[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/util ...

Manik Surtani msurtani at jboss.com
Thu Jan 4 00:35:39 EST 2007


  User: msurtani
  Date: 07/01/04 00:35:39

  Modified:    src-50/org/jboss/cache/pojo/util  CacheApiUtil.java
  Log:
  Major changes around nodes, and the way they interact with the interceptor stack.
  Also removed redundant methods in NodeSPI and removed the need for casting to NodeSPI in most cases.
  
  Revision  Changes    Path
  1.8       +10 -8     JBossCache/src-50/org/jboss/cache/pojo/util/CacheApiUtil.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheApiUtil.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/util/CacheApiUtil.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- CacheApiUtil.java	3 Jan 2007 06:23:25 -0000	1.7
  +++ CacheApiUtil.java	4 Jan 2007 05:35:39 -0000	1.8
  @@ -10,6 +10,7 @@
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Node;
  +import org.jboss.cache.NodeSPI;
   import org.jboss.cache.config.Option;
   
   import java.util.Map;
  @@ -19,34 +20,35 @@
    * Utility for the 2.0 Cache API
    *
    * @author Ben Wang
  - * @version $Id: CacheApiUtil.java,v 1.7 2007/01/03 06:23:25 bwang Exp $
  + * @version $Id: CacheApiUtil.java,v 1.8 2007/01/04 05:35:39 msurtani Exp $
    */
   public class CacheApiUtil
   {
      public static Node XgetDataNode(CacheSPI cache, Fqn fqn)
      {
  -//      cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
  +      //      cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
         Node node = cache.getRoot().getChild(fqn);
         if (node == null) return null;
   
  -//      cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
  +      //      cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(false);
         return node;
      }
   
      public static Set<Node> getNodeChildren(CacheSPI cache, Fqn fqn)
      {
         Node n = cache.getRoot().getChild(fqn);
  -      if(n == null) return null;
  +      if (n == null) return null;
   
         if (cache.getCacheLoaderManager() != null)
         {
            // We have cache loader, we can't get it directly from the local get.
            return n.getChildren();
  -      } else
  +      }
  +      else
         {
            Option option = cache.getInvocationContext().getOptionOverrides();
            // WIll run into some race error in LocalTest for Set.
  -//         option.setBypassInterceptorChain(true);
  +         //         option.setBypassInterceptorChain(true);
            return n.getChildren();
         }
      }
  @@ -59,9 +61,9 @@
            return (cache.get(fqn, key) != null) ? true : false;
         }
   
  -      Node node = cache.getRoot().getChild(fqn);
  +      NodeSPI node = cache.getRoot().getChildDirect(fqn);
         if (node == null) return false;
  -      Map map = node.getData();
  +      Map map = node.getDataDirect();
         return (map.keySet().contains(key)) ? true : false;
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list