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

Manik Surtani msurtani at jboss.com
Thu Aug 24 10:57:52 EDT 2006


  User: msurtani
  Date: 06/08/24 10:57:52

  Modified:    src/org/jboss/cache    RegionImpl.java TreeCache.java
                        TreeCacheProxyImpl.java
  Log:
  opt locking and state transfer/region mgmt fixes
  
  Revision  Changes    Path
  1.2       +2 -8      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.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- RegionImpl.java	18 Jul 2006 10:50:46 -0000	1.1
  +++ RegionImpl.java	24 Aug 2006 14:57:52 -0000	1.2
  @@ -10,9 +10,6 @@
   import org.jboss.cache.marshall.RegionNameConflictException;
   import org.jboss.cache.marshall.RegionNotFoundException;
   
  -import java.util.Map;
  -import java.util.HashMap;
  -
   /**
    * Default implementation of a {@link Region}
    *
  @@ -20,10 +17,7 @@
    */
   public class RegionImpl implements Region
   {
  -    /**
  -     * A registry of regions that have been defined.
  -     */
  -    static Map<Fqn,Region> REGIONS_REGISTRY = new HashMap<Fqn, Region>();
  +
       TreeCache treeCache;
       Fqn fqn;
   
  @@ -36,7 +30,7 @@
       {
           this.treeCache = c;
           this.fqn = fqn;
  -        REGIONS_REGISTRY.put(fqn, this);
  +        this.treeCache.regionsRegistry.put(fqn, this);
       }
   
       public void registerContextClassLoader(ClassLoader classLoader) throws RegionNameConflictException
  
  
  
  1.225     +10 -2     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.224
  retrieving revision 1.225
  diff -u -b -r1.224 -r1.225
  --- TreeCache.java	24 Aug 2006 14:47:17 -0000	1.224
  +++ TreeCache.java	24 Aug 2006 14:57:52 -0000	1.225
  @@ -74,7 +74,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.224 2006/08/24 14:47:17 msurtani Exp $
  + * @version $Id: TreeCache.java,v 1.225 2006/08/24 14:57:52 msurtani Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -92,6 +92,11 @@
       */
      protected DataNode root = NodeFactory.getInstance().createRootDataNode(NodeFactory.NODE_TYPE_TREENODE, this);
   
  +   /**
  +     * A registry of regions that have been defined.
  +     */
  +    Map<Fqn,org.jboss.cache.Region> regionsRegistry = null;
  +
      final static Object NULL = new Object();
   
      /**
  @@ -647,8 +652,11 @@
         }
   
         useCreateService = true;
  +      if (configuration.isUseRegionBasedMarshalling())
  +      {
  +          regionsRegistry = new HashMap<Fqn, org.jboss.cache.Region>();
  +      }
      }
  -
   
       protected boolean shouldFetchStateOnStartup()
       {
  
  
  
  1.17      +10 -11    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.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- TreeCacheProxyImpl.java	22 Aug 2006 12:27:52 -0000	1.16
  +++ TreeCacheProxyImpl.java	24 Aug 2006 14:57:52 -0000	1.17
  @@ -5,32 +5,31 @@
    * See terms of license at gnu.org.
    */
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.buddyreplication.BuddyManager;
   import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.eviction.RegionManager;
  +import org.jboss.cache.factories.NodeFactory;
   import org.jboss.cache.interceptors.Interceptor;
   import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.loader.CacheLoaderManager;
   import org.jboss.cache.lock.IdentityLock;
  -import org.jboss.cache.eviction.RegionManager;
  -import org.jboss.cache.statetransfer.StateTransferManager;
  -import org.jboss.cache.factories.NodeFactory;
   import org.jboss.cache.notifications.Notifier;
  -import org.jboss.invocation.*;
  +import org.jboss.cache.statetransfer.StateTransferManager;
   import org.jgroups.Address;
   import org.jgroups.blocks.MethodCall;
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
   
   import javax.management.ObjectName;
  -import javax.transaction.TransactionManager;
   import javax.transaction.Transaction;
  +import javax.transaction.TransactionManager;
   import java.util.Collection;
  +import java.util.Collections;
  +import java.util.HashSet;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
   import java.util.Set;
  -import java.util.HashSet;
  -import java.util.Collections;
   
   /**
    * Implementation of a proxy class that adheres to new 2.0.0 interfaces while maintaining the old 1.x.x
  @@ -238,9 +237,9 @@
   
       public Region getRegion(Fqn fqn)
       {
  -        if (RegionImpl.REGIONS_REGISTRY.containsKey(fqn))
  +        if (treeCache.regionsRegistry.containsKey(fqn))
           {
  -            return RegionImpl.REGIONS_REGISTRY.get(fqn);
  +            return treeCache.regionsRegistry.get(fqn);
           }
           else
           {
  
  
  



More information about the jboss-cvs-commits mailing list