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

Brian Stansberry brian.stansberry at jboss.com
Mon Jan 29 00:25:00 EST 2007


  User: bstansberry
  Date: 07/01/29 00:25:00

  Modified:    src/org/jboss/cache  Tag: Branch_JBossCache_1_4_0
                        TreeCache.java
  Log:
  [JBCACHE-921] Cleanup up partially evicted nodes
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.195.2.43 +21 -5     JBossCache/src/org/jboss/cache/Attic/TreeCache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Attic/TreeCache.java,v
  retrieving revision 1.195.2.42
  retrieving revision 1.195.2.43
  diff -u -b -r1.195.2.42 -r1.195.2.43
  --- TreeCache.java	19 Jan 2007 13:28:22 -0000	1.195.2.42
  +++ TreeCache.java	29 Jan 2007 05:24:59 -0000	1.195.2.43
  @@ -99,7 +99,7 @@
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @author Brian Stansberry
    * @author Daniel Huang (dhuang at jboss.org)
  - * @version $Id: TreeCache.java,v 1.195.2.42 2007/01/19 13:28:22 msurtani Exp $
  + * @version $Id: TreeCache.java,v 1.195.2.43 2007/01/29 05:24:59 bstansberry Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -4945,11 +4945,17 @@
       * Internal evict method called by eviction policy provider.
       *
       * @param fqn removes everything assoicated with this FQN
  +    * 
  +    * @return <code>true</code> if the node has been completely removed, 
  +    *         <code>false</code> if only the data map was removed, due
  +    *         to the presence of children
  +    *         
       * @throws CacheException
       */
  -   public void _evict(Fqn fqn) throws CacheException
  +   public boolean _evict(Fqn fqn) throws CacheException
      {
  -      if (!exists(fqn)) return;   // node does not exist. Maybe it has been recursively removed.
  +      if (!exists(fqn)) 
  +         return true;   // node does not exist. Maybe it has been recursively removed.
         // use remove method now if there is a child node. Otherwise, it is removed
         boolean create_undo_ops = false;
         boolean sendNodeEvent = false;
  @@ -4959,10 +4965,12 @@
         if (hasChild(fqn))
         {
            _removeData(null, fqn, create_undo_ops, sendNodeEvent, eviction);
  +         return false;
         }
         else
         {
            _remove(null, fqn, create_undo_ops, sendNodeEvent, eviction);
  +         return true;
         }
      }
   
  @@ -4971,11 +4979,17 @@
       *
       * @param fqn
       * @param version
  +    * 
  +    * @return <code>true</code> if the node has been completely removed, 
  +    *         <code>false</code> if only the data map was removed, due
  +    *         to the presence of children
  +    *         
       * @throws CacheException
       */
  -   public void _evict(Fqn fqn, DataVersion version) throws CacheException
  +   public boolean _evict(Fqn fqn, DataVersion version) throws CacheException
      {
  -      if (!exists(fqn)) return;  // node does not exist
  +      if (!exists(fqn)) 
  +         return true;  // node does not exist
   
         boolean create_undo_ops = false;
         boolean sendNodeEvent = false;
  @@ -4985,10 +4999,12 @@
         if (hasChild(fqn))
         {
            _removeData(null, fqn, create_undo_ops, sendNodeEvent, eviction, version);
  +         return false;
         }
         else
         {
            _remove(null, fqn, create_undo_ops, sendNodeEvent, eviction, version);
  +         return true;
         }
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list