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

Brian Stansberry brian.stansberry at jboss.com
Thu Oct 26 15:30:21 EDT 2006


  User: bstansberry
  Date: 06/10/26 15:30:21

  Modified:    src/org/jboss/cache/loader/bdbje   BdbjeCacheLoader.java
  Added:       src/org/jboss/cache/loader/bdbje  
                        BdbjeCacheLoaderConfig.java
  Log:
  Make cache loader Config classes top level classes
  
  Revision  Changes    Path
  1.19      +5 -56     JBossCache/src/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BdbjeCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -b -r1.18 -r1.19
  --- BdbjeCacheLoader.java	24 Oct 2006 17:53:35 -0000	1.18
  +++ BdbjeCacheLoader.java	26 Oct 2006 19:30:21 -0000	1.19
  @@ -34,7 +34,6 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  -import java.util.Properties;
   import java.util.Set;
   
   
  @@ -51,7 +50,7 @@
    *
    * @author Mark Hayes May 16, 2004
    * @author Bela Ban
  - * @version $Id: BdbjeCacheLoader.java,v 1.18 2006/10/24 17:53:35 msurtani Exp $
  + * @version $Id: BdbjeCacheLoader.java,v 1.19 2006/10/26 19:30:21 bstansberry Exp $
    */
   public class BdbjeCacheLoader extends AbstractCacheLoader
   {
  @@ -61,7 +60,7 @@
   
      private static final Log log = LogFactory.getLog(BdbjeCacheLoader.class);
   
  -   private Config config;
  +   private BdbjeCacheLoaderConfig config;
      private Environment env;
      private String cacheDbName;
      private String catalogDbName;
  @@ -279,13 +278,13 @@
      {
         checkNotOpen();
         
  -      if (base instanceof Config)
  +      if (base instanceof BdbjeCacheLoaderConfig)
         {
  -         this.config = (Config) base;
  +         this.config = (BdbjeCacheLoaderConfig) base;
         }
         else
         {
  -         config = new Config(base);
  +         config = new BdbjeCacheLoaderConfig(base);
         }
         
         if (log.isTraceEnabled()) log.trace("Configuring cache loader with location = " + config.getLocation());
  @@ -1142,54 +1141,4 @@
                    "Parameter must not be null: " + paramName);
         }
      }
  -   
  -   public static class Config extends IndividualCacheLoaderConfig
  -   {
  -      private static final long serialVersionUID = 4626734068542420865L;
  -      
  -      private String location;
  -
  -      public Config() 
  -      {
  -         setClassName(BdbjeCacheLoader.class.getName());
  -      }
  -      
  -      private Config(IndividualCacheLoaderConfig base)
  -      {
  -         setClassName(BdbjeCacheLoader.class.getName());
  -         populateFromBaseConfig(base);
  -      }
  -      
  -      public String getLocation()
  -      {
  -         return location;
  -      }
  -
  -      public void setLocation(String location)
  -      {
  -         testImmutability("location");
  -         this.location = location;
  -      }
  -
  -      public void setProperties(Properties props)
  -      {
  -         super.setProperties(props);
  -         setLocation(props != null ? props.getProperty("location") : null);
  -      }
  -
  -      public boolean equals(Object obj)
  -      {
  -         if (obj instanceof Config && equalsExcludingProperties(obj))
  -         {
  -            return  safeEquals(location, ((Config) obj).location);
  -         }
  -         return false;
  -      }
  -      
  -      public int hashCode()
  -      {
  -         return 31 * hashCodeExcludingProperties() + (location == null ? 0 : location.hashCode());
  -      }     
  -      
  -   }
   }
  
  
  
  1.1      date: 2006/10/26 19:30:21;  author: bstansberry;  state: Exp;JBossCache/src/org/jboss/cache/loader/bdbje/BdbjeCacheLoaderConfig.java
  
  Index: BdbjeCacheLoaderConfig.java
  ===================================================================
  package org.jboss.cache.loader.bdbje;
  
  import java.util.Properties;
  
  import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
  
  public class BdbjeCacheLoaderConfig extends IndividualCacheLoaderConfig
  {
     private static final long serialVersionUID = 4626734068542420865L;
     
     private String location;
  
     public BdbjeCacheLoaderConfig() 
     {
        setClassName(BdbjeCacheLoader.class.getName());
     }
     
     /**
      * For use by {@link BdbjeCacheLoader}.
      * 
      * @param base generic config object created by XML parsing.
      */
     BdbjeCacheLoaderConfig(IndividualCacheLoaderConfig base)
     {
        setClassName(BdbjeCacheLoader.class.getName());
        populateFromBaseConfig(base);
     }
     
     public String getLocation()
     {
        return location;
     }
  
     public void setLocation(String location)
     {
        testImmutability("location");
        this.location = location;
     }
  
     public void setProperties(Properties props)
     {
        super.setProperties(props);
        setLocation(props != null ? props.getProperty("location") : null);
     }
  
     public boolean equals(Object obj)
     {
        if (obj instanceof BdbjeCacheLoaderConfig && equalsExcludingProperties(obj))
        {
           return  safeEquals(location, ((BdbjeCacheLoaderConfig) obj).location);
        }
        return false;
     }
     
     public int hashCode()
     {
        return 31 * hashCodeExcludingProperties() + (location == null ? 0 : location.hashCode());
     }     
     
  }
  
  



More information about the jboss-cvs-commits mailing list