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

Manik Surtani msurtani at jboss.com
Wed Nov 15 11:30:38 EST 2006


  User: msurtani
  Date: 06/11/15 11:30:38

  Modified:    src/org/jboss/cache    TreeCache.java RegionImpl.java
                        RegionManager.java
  Log:
  Fixed eviction breakages
  
  Revision  Changes    Path
  1.270     +4 -1      JBossCache/src/org/jboss/cache/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/TreeCache.java,v
  retrieving revision 1.269
  retrieving revision 1.270
  diff -u -b -r1.269 -r1.270
  --- TreeCache.java	15 Nov 2006 15:16:40 -0000	1.269
  +++ TreeCache.java	15 Nov 2006 16:30:38 -0000	1.270
  @@ -94,7 +94,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.269 2006/11/15 15:16:40 msurtani Exp $
  + * @version $Id: TreeCache.java,v 1.270 2006/11/15 16:30:38 msurtani Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -797,6 +797,9 @@
         // TODO should this be moved above the buddy manager code??
         determineCoordinator();
   
  +      // start any eviction threads.
  +      if (regionManager.isUsingEvictions()) regionManager.startEvictionThread();
  +
         notifier.notifyCacheStarted(getCacheSPI());
         started = true;
         log.info("JBoss Cache version: " + getVersion());
  
  
  
  1.11      +2 -1      JBossCache/src/org/jboss/cache/RegionImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RegionImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RegionImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- RegionImpl.java	15 Nov 2006 16:02:43 -0000	1.10
  +++ RegionImpl.java	15 Nov 2006 16:30:38 -0000	1.11
  @@ -134,7 +134,6 @@
   
      public void putNodeEvent(EvictedEventNode event)
      {
  -      if (nodeEventQueue_ == null) createQueue();
         try
         {
            // Don't check capacity every time as this is an expensive operation for
  @@ -228,6 +227,8 @@
      {
         configuration.setEvictionPolicyConfig(evictionPolicyConfig);
         policy = createPolicy(evictionPolicyConfig.getEvictionPolicyClass());
  +      regionManager.getEvictionTimerTask().addRegionToProcess(this);
  +      if (nodeEventQueue_ == null) createQueue();
      }
   
      private EvictionPolicy createPolicy(String className)
  
  
  
  1.7       +21 -3     JBossCache/src/org/jboss/cache/RegionManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RegionManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RegionManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- RegionManager.java	15 Nov 2006 15:16:40 -0000	1.6
  +++ RegionManager.java	15 Nov 2006 16:30:38 -0000	1.7
  @@ -7,6 +7,7 @@
   import org.jboss.cache.config.EvictionRegionConfig;
   import org.jboss.cache.config.ConfigurationException;
   import org.jboss.cache.eviction.RegionNameConflictException;
  +import org.jboss.cache.eviction.EvictionTimerTask;
   
   import java.util.ArrayList;
   import java.util.Collections;
  @@ -37,7 +38,7 @@
      TreeCache treeCache;
      private boolean usingEvictions;
      private EvictionConfig evictionConfig;
  -
  +   private EvictionTimerTask evictionTimerTask = new EvictionTimerTask();
   
   
      public RegionManager()
  @@ -197,7 +198,19 @@
   
      public void removeRegion(Fqn fqn)
      {
  -      regionsRegistry.remove(fqn);
  +      Region r = regionsRegistry.remove(fqn);
  +      if (isUsingEvictions() && r.getEvictionPolicy() != null)
  +      {
  +         evictionTimerTask.removeRegionToProcess(r);
  +      }
  +   }
  +
  +   /**
  +    * @return the eviction timer task object associated with this Region Manager.
  +    */
  +   protected EvictionTimerTask getEvictionTimerTask()
  +   {
  +      return evictionTimerTask;
      }
   
   
  @@ -368,6 +381,11 @@
            r.setEvictionPolicy(erc.getEvictionPolicyConfig());
         }      
      }
  +
  +   public void startEvictionThread()
  +   {
  +      evictionTimerTask.init(evictionConfig.getWakeupIntervalSeconds(), treeCache.getNotifier());
  +   }
   }
   
   
  @@ -385,7 +403,7 @@
    * @author Ben Wang 02-2004
    * @author Daniel Huang (dhuang at jboss.org)
    * @author Brian Stansberry
  - * @version $Id: RegionManager.java,v 1.6 2006/11/15 15:16:40 msurtani Exp $
  + * @version $Id: RegionManager.java,v 1.7 2006/11/15 16:30:38 msurtani Exp $
    */
   /*public class ERegionManager
   {
  
  
  



More information about the jboss-cvs-commits mailing list