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

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


  User: bstansberry
  Date: 07/01/29 00:10:28

  Modified:    src/org/jboss/cache  CacheImpl.java
  Log:
  [JBCACHE-921] Cleanup up partially evicted nodes
  
  Revision  Changes    Path
  1.39      +20 -4     JBossCache/src/org/jboss/cache/CacheImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -b -r1.38 -r1.39
  --- CacheImpl.java	26 Jan 2007 11:35:12 -0000	1.38
  +++ CacheImpl.java	29 Jan 2007 05:10:28 -0000	1.39
  @@ -2517,11 +2517,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;
  @@ -2533,10 +2539,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;
         }
      }
   
  @@ -2545,11 +2553,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;
  @@ -2561,10 +2575,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