[jboss-cvs] JBossCache/src/org/jboss/cache ...

Manik Surtani msurtani at jboss.com
Thu Aug 17 13:34:59 EDT 2006


  User: msurtani
  Date: 06/08/17 13:34:59

  Modified:    src/org/jboss/cache      AbstractNode.java CacheSPI.java
                        Node.java NodeImpl.java TreeCacheProxyImpl.java
  Log:
  Habanero stabilisation efforts - cache loading
  
  Revision  Changes    Path
  1.19      +16 -15    JBossCache/src/org/jboss/cache/AbstractNode.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractNode.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/AbstractNode.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -b -r1.18 -r1.19
  --- AbstractNode.java	18 Jul 2006 16:32:48 -0000	1.18
  +++ AbstractNode.java	17 Aug 2006 17:34:59 -0000	1.19
  @@ -10,6 +10,7 @@
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Map;
  +import java.util.Collections;
   
   /**
    * Base class for {@link NodeImpl}.
  @@ -78,7 +79,7 @@
   
      public Map getChildren()
      {
  -      return children;
  +      return children == null ? Collections.emptyMap() : children;
      }
   
      public void setChildren(Map children)
  
  
  
  1.8       +0 -16     JBossCache/src/org/jboss/cache/CacheSPI.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheSPI.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheSPI.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- CacheSPI.java	16 Aug 2006 10:52:51 -0000	1.7
  +++ CacheSPI.java	17 Aug 2006 17:34:59 -0000	1.8
  @@ -130,22 +130,6 @@
   
       Map getLockTable();
   
  -    // TODO: Figure out how we deal with these:
  -    DataNode peek(Fqn fqn);
  -
  -    void _evict(Fqn fqn);
  -
  -    void notifyNodeLoaded(Fqn fqn);
  -
  -
  -    void notifyNodeCreated(Fqn fqn);
  -
  -    Node _get(Fqn fqn);
  -
  -    void notifyNodeActivate(Fqn fqn, boolean b);
  -
  -    void notifyNodePassivate(Fqn fqn, boolean b);
  -
       org.jboss.cache.marshall.RegionManager getRegionManager();
   
       List _gravitateData(Fqn fqn, boolean b, boolean b1);
  
  
  
  1.45      +0 -0      JBossCache/src/org/jboss/cache/Node.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  
  
  
  1.5       +10 -11    JBossCache/src/org/jboss/cache/NodeImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/NodeImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- NodeImpl.java	16 Aug 2006 10:52:51 -0000	1.4
  +++ NodeImpl.java	17 Aug 2006 17:34:59 -0000	1.5
  @@ -29,6 +29,7 @@
   import java.util.Iterator;
   import java.util.Map;
   import java.util.Set;
  +import java.util.Collections;
   
   /**
    * Basic data node class.
  @@ -189,9 +190,7 @@
        */
      public Set getDataKeys() {
         synchronized(this) {
  -         if (data == null)
  -            //return Collections.emptySet(); // this is JDK5 only!!  Sucks!
  -            return new HashSet(0);
  +         if (data == null) return Collections.emptySet();
            return data.keySet();
         }
      }
  
  
  
  1.12      +27 -27    JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheProxyImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- TreeCacheProxyImpl.java	16 Aug 2006 10:52:51 -0000	1.11
  +++ TreeCacheProxyImpl.java	17 Aug 2006 17:34:59 -0000	1.12
  @@ -278,6 +278,11 @@
           return children;
       }
   
  +    public void setChildren(Map<Object, Node> children)
  +    {
  +        currentNode.setChildren(children);
  +    }
  +
       public Map getData()
       {
           return currentNode.getData();
  @@ -353,8 +358,16 @@
   
       public void put(Object k, Object v)
       {
  +        if (InvocationContext.getOptionOverrides().isBypassInterceptorChain())
  +        {
  +            currentNode.put(k, v);
  +            InvocationContext.getOptionOverrides().setBypassInterceptorChain(false);
  +        }
  +        else
  +        {
           treeCache.put(currentNode.getFqn(), k, v);
       }
  +    }
   
       public void putIfNull(Object k, Object v)
       {
  @@ -459,46 +472,26 @@
           return currentNode.acquireAll(owner, lock_timeout, lockType);
       }
   
  -    // TODO: Figure out how we deal with these:
       public DataNode peek(Fqn fqn)
       {
           return treeCache.peek(fqn);
  -        //throw new RuntimeException("TODO: Need to figure out how to deal with these.");
  -    }
  -
  -    public void _evict(Fqn fqn)
  -    {
  -        throw new RuntimeException("TODO: Need to figure out how to deal with these.");
  -    }
  -
  -    public void notifyNodeLoaded(Fqn fqn)
  -    {
  -        throw new RuntimeException("TODO: Need to figure out how to deal with these.");
       }
   
  -    public void notifyNodeCreated(Fqn fqn)
  +    public Node peekNode(Fqn fqn)
       {
  -        throw new RuntimeException("TODO: Need to figure out how to deal with these.");
  -    }
   
  -    public Node _get(Fqn fqn)
  -    {
  -        throw new RuntimeException("TODO: Need to figure out how to deal with these.");
  +        NodeImpl node = (NodeImpl) treeCache.peek(fqn);
  +        return node == null ? null : new TreeCacheProxyImpl(treeCache, node);
       }
   
  -    public void notifyNodeActivate(Fqn fqn, boolean b)
  -    {
  -        throw new RuntimeException("TODO: Need to figure out how to deal with these.");
  -    }
  -
  -    public void notifyNodePassivate(Fqn fqn, boolean b)
  +    public void _evict(Fqn fqn)
       {
           throw new RuntimeException("TODO: Need to figure out how to deal with these.");
       }
   
       public org.jboss.cache.marshall.RegionManager getRegionManager()
       {
  -    throw new RuntimeException("TODO: Need to figure out how to deal with these.");
  +        return treeCache.getRegionManager();
       }
   
       public List _gravitateData(Fqn fqn, boolean b, boolean b1)
  @@ -517,6 +510,13 @@
       }
   
   
  +    public boolean getChildrenLoaded()
  +    {
  +        return currentNode.getChildrenLoaded();
  +    }
   
  -
  +    public void setChildrenLoaded(boolean b)
  +    {
  +        currentNode.setChildrenLoaded(b);
  +    }
   }
  
  
  



More information about the jboss-cvs-commits mailing list