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

Brian Stansberry brian.stansberry at jboss.com
Mon Oct 23 01:46:39 EDT 2006


  User: bstansberry
  Date: 06/10/23 01:46:39

  Modified:    src/org/jboss/cache/loader             
                        TcpDelegatingCacheLoader.java CacheLoader.java
                        CacheLoaderManager.java ChainingCacheLoader.java
                        DelegatingCacheLoader.java
                        ClusteredCacheLoader.java FileCacheLoader.java
                        AbstractDelegatingCacheLoader.java
                        AsyncCacheLoader.java RmiDelegatingCacheLoader.java
                        LocalDelegatingCacheLoader.java
                        JDBCCacheLoader.java RpcDelegatingCacheLoader.java
  Log:
  [JBCACHE-809] Pojo-style configuration for use by Microcontainer
  
  Revision  Changes    Path
  1.4       +104 -15   JBossCache/src/org/jboss/cache/loader/TcpDelegatingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TcpDelegatingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/TcpDelegatingCacheLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- TcpDelegatingCacheLoader.java	22 Sep 2006 16:27:56 -0000	1.3
  +++ TcpDelegatingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.4
  @@ -8,6 +8,7 @@
   
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   
   import java.io.IOException;
   import java.io.ObjectInputStream;
  @@ -30,13 +31,12 @@
    * </pre>
    *
    * @author Bela Ban
  - * @version $Id: TcpDelegatingCacheLoader.java,v 1.3 2006/09/22 16:27:56 msurtani Exp $
  + * @version $Id: TcpDelegatingCacheLoader.java,v 1.4 2006/10/23 05:46:39 bstansberry Exp $
    */
   public class TcpDelegatingCacheLoader extends DelegatingCacheLoader
   {
      private Socket sock;
  -   private String host;
  -   private int port;
  +   private Config config;
      ObjectInputStream in;
      ObjectOutputStream out;
   
  @@ -57,8 +57,7 @@
       */
      public TcpDelegatingCacheLoader(String host, int port)
      {
  -      this.host = host;
  -      this.port = port;
  +      this.config = new Config(host, port);
      }
   
      /**
  @@ -66,14 +65,21 @@
       *
       * @see DelegatingCacheLoader#setConfig(java.util.Properties)
       */
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig base)
      {
  -      this.host = props.getProperty("host");
  -      if (this.host == null || this.host.length() == 0)
  +      if (base instanceof Config)
  +      {
  +         this.config = (Config) base;
  +      }
  +      else
         {
  -         this.host = "localhost";
  +         config = new Config(base);
         }
  -      this.port = Integer.parseInt(props.getProperty("port"));
  +   }
  +   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
      }
   
      public void start() throws Exception
  @@ -109,11 +115,7 @@
   
      private void init() throws IOException
      {
  -      if (host == null)
  -      {
  -         host = "localhost";
  -      }
  -      sock = new Socket(host, port);
  +      sock = new Socket(config.getHost(), config.getPort());
         out = new ObjectOutputStream(sock.getOutputStream());
         in = new ObjectInputStream(sock.getInputStream());
      }
  @@ -299,4 +301,91 @@
         throw new UnsupportedOperationException("operation is not currently supported - need to define semantics first");
      }
   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      /** The serialVersionUID */
  +      private static final long serialVersionUID = -3138555335000168505L;
  +      
  +      private String host = "localhost";
  +      private int port;;
  +      
  +      public Config()
  +      {
  +         setClassName(TcpDelegatingCacheLoader.class.getName());
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {
  +         setClassName(TcpDelegatingCacheLoader.class.getName());
  +         populateFromBaseConfig(base);
  +      }
  +      
  +      private Config(String host, int port)
  +      {
  +         setClassName(TcpDelegatingCacheLoader.class.getName());
  +         this.host = host;
  +         this.port = port;
  +      }
  +
  +      public String getHost()
  +      {
  +         return host;
  +      }
  +
  +      public void setHost(String host)
  +      {
  +         testImmutability("host");
  +         this.host = host;
  +      }
  +
  +      public int getPort()
  +      {
  +         return port;
  +      }
  +
  +      public void setPort(int port)
  +      {
  +         testImmutability("port");
  +         this.port = port;
  +      }
  +
  +      public void setProperties(Properties props)
  +      {
  +         super.setProperties(props);
  +         String s = props.getProperty("host");
  +         if (s != null && s.length() > 0)
  +         {
  +            this.host = s;
  +         }
  +         s = props.getProperty("port");
  +         if (s != null && s.length() > 0)
  +         {
  +            this.port = Integer.parseInt(s);
  +         }
  +      }
  +
  +      public boolean equals(Object obj)
  +      {
  +         if (obj instanceof Config && equalsExcludingProperties(obj))
  +         {
  +            Config other = (Config) obj;
  +            
  +            return safeEquals(host, other.host)
  +                     && (port == other.port);            
  +         }
  +         return false;
  +      }
  +
  +      public int hashCode()
  +      {
  +         int result = hashCodeExcludingProperties();
  +         result = 31 * result + (host == null ? 0 : host.hashCode());
  +         result = 31 * result + port;
  +         
  +         return result;
  +      }
  +      
  +      
  +   }
  +
   }
  
  
  
  1.11      +23 -13    JBossCache/src/org/jboss/cache/loader/CacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/CacheLoader.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- CacheLoader.java	12 Oct 2006 23:03:57 -0000	1.10
  +++ CacheLoader.java	23 Oct 2006 05:46:39 -0000	1.11
  @@ -6,17 +6,17 @@
    */
   package org.jboss.cache.loader;
   
  -import org.jboss.cache.CacheSPI;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
  +import org.jboss.cache.RegionManager;
   import org.jboss.cache.Fqn;
  +import org.jboss.cache.CacheSPI;
   import org.jboss.cache.Modification;
  -import org.jboss.cache.RegionManager;
   
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
  -import java.util.List;
  -import java.util.Map;
  -import java.util.Properties;
   import java.util.Set;
  +import java.util.Map;
  +import java.util.List;
   
   /**
    * A <code>CacheLoader</code> implementation persists and load keys to and from
  @@ -26,7 +26,7 @@
    * {@link Map} should be atomic.
    * <p/>
    * Lifecycle: First an instance of the loader is created, then the
  - * configuration ({@link #setConfig(java.util.Properties)} ) and cache ({@link
  + * configuration ({@link #setConfig(IndividualCacheLoaderConfig)} ) and cache ({@link
    * #setCache(CacheSPI)}) are set. After this, {@link #create()} is called.
    * Then {@link #start()} is called. When re-deployed, {@link #stop()} will be
    * called, followed by another {@link #start()}. Finally, when shut down,
  @@ -41,11 +41,21 @@
   {
      /**
       * Sets the configuration.  This is called before {@link #create()} and {@link #start()}.
  -    *
  -    * @param properties a collection of configuration properties
  +     * @param config    May be an instance of the IndividualCacheLoaderConfig base
  +     *                  class, in which case the cache loader should use the 
  +     *                  {@link IndividualCacheLoaderConfig#getProperties() getProperties()}
  +     *                  method to find configuration information. Alternatively,
  +     *                  may be a type-specific subclass of IndividualCacheLoaderConfig,
  +     *                  if there is one.
       */
  -   void setConfig(Properties properties);
  +    void setConfig(IndividualCacheLoaderConfig config);
   
  +    /**
  +     * Gets the configuration.
  +     * 
  +     * @return the configuration
  +     */
  +    IndividualCacheLoaderConfig getConfig();
   
      /**
       * Sets the {@link CacheSPI} that is maintaining this CacheLoader.
  
  
  
  1.26      +13 -1     JBossCache/src/org/jboss/cache/loader/CacheLoaderManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoaderManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/CacheLoaderManager.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -b -r1.25 -r1.26
  --- CacheLoaderManager.java	29 Sep 2006 18:27:21 -0000	1.25
  +++ CacheLoaderManager.java	23 Oct 2006 05:46:39 -0000	1.26
  @@ -12,11 +12,13 @@
   import org.jboss.cache.Fqn;
   import org.jboss.cache.CacheListener;
   import org.jboss.cache.config.CacheLoaderConfig;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.cache.xml.XmlHelper;
   import org.w3c.dom.Element;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
   
  +import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.Set;
   import java.util.StringTokenizer;
  @@ -127,6 +129,9 @@
         // if we only have a single cache loader configured in the chaining cacheloader then
         // don't use a chaining cache loader at all.
   
  +      ArrayList<IndividualCacheLoaderConfig> finalConfigs = 
  +         new ArrayList<IndividualCacheLoaderConfig>();
  +      
         // also if we are using passivation then just directly use the first cache loader.
         if (config.useChainingCacheLoader())
         {
  @@ -155,18 +160,25 @@
               }
   
               CacheLoader l = createCacheLoader(cfg, cache);
  +            cfg = l.getConfig();
  +            finalConfigs.add(cfg);
               // Only loaders that deal w/ state transfer factor into
               // whether the overall chain supports ExtendedCacheLoader
               ccl.addCacheLoader(l, cfg);
  +            
            }
         }
         else
         {
            CacheLoaderConfig.IndividualCacheLoaderConfig cfg = (CacheLoaderConfig.IndividualCacheLoaderConfig) config.getIndividualCacheLoaderConfigs().get(0);
            tmpLoader = createCacheLoader(cfg, cache);
  +         finalConfigs.add(tmpLoader.getConfig());
            fetchPersistentState = cfg.isFetchPersistentState();
         }
   
  +      // Update the config with those actually used by the loaders
  +      config.setIndividualCacheLoaderConfigs(finalConfigs);
  +
         return tmpLoader;
      }
   
  @@ -202,7 +214,7 @@
            }
   
            // load props
  -         tmpLoader.setConfig(cfg.getProperties());
  +         tmpLoader.setConfig(cfg);
   
            tmpLoader.setCache(cache);
            // we should not be creating/starting the cache loader here - this should be done in the separate
  
  
  
  1.12      +10 -5     JBossCache/src/org/jboss/cache/loader/ChainingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ChainingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/ChainingCacheLoader.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- ChainingCacheLoader.java	12 Oct 2006 23:03:57 -0000	1.11
  +++ ChainingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.12
  @@ -8,8 +8,9 @@
   
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  -import org.jboss.cache.RegionManager;
   import org.jboss.cache.config.CacheLoaderConfig;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
  +import org.jboss.cache.RegionManager;
   
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
  @@ -18,7 +19,6 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  -import java.util.Properties;
   import java.util.Set;
   
   /**
  @@ -39,13 +39,18 @@
      /**
       * Sets the configuration. Will be called before {@link #create()} and {@link #start()}
       *
  -    * @param url A list of properties, defined in the XML file
  +    * @param config ignored
       */
  -   public void setConfig(Properties url)
  +   public void setConfig(IndividualCacheLoaderConfig config)
      {
         // don't do much here?
      }
   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return null;
  +   }
  +
      /**
       * Returns a list of children names, all names are <em>relative</em>. Returns null if the parent node is not found.
       * The returned set must not be modified, e.g. use Collections.unmodifiableSet(s) to return the result
  @@ -324,7 +329,7 @@
      }
   
      /**
  -    * No-op, as this class doesn't directly use the MarshRegionManager.
  +    * No-op, as this class doesn't directly use the RegionManager.
       */
      public void setRegionManager(RegionManager manager)
      {
  
  
  
  1.12      +1 -5      JBossCache/src/org/jboss/cache/loader/DelegatingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DelegatingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/DelegatingCacheLoader.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- DelegatingCacheLoader.java	22 Sep 2006 16:27:56 -0000	1.11
  +++ DelegatingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.12
  @@ -16,7 +16,6 @@
   import java.util.HashMap;
   import java.util.List;
   import java.util.Map;
  -import java.util.Properties;
   import java.util.Set;
   
   /**
  @@ -26,7 +25,7 @@
    *
    * @author Bela Ban
    * @author Daniel Gredler
  - * @version $Id: DelegatingCacheLoader.java,v 1.11 2006/09/22 16:27:56 msurtani Exp $
  + * @version $Id: DelegatingCacheLoader.java,v 1.12 2006/10/23 05:46:39 bstansberry Exp $
    */
   public abstract class DelegatingCacheLoader extends AbstractCacheLoader
   {
  @@ -50,9 +49,6 @@
      public static final int delegateStoreEntireState = 11;
      public static final int putList = 12;
   
  -
  -   public abstract void setConfig(Properties props);
  -
      public Set<String> getChildrenNames(Fqn fqn) throws Exception
      {
         Set<String> retval = delegateGetChildrenNames(fqn);
  
  
  
  1.15      +76 -8     JBossCache/src/org/jboss/cache/loader/ClusteredCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ClusteredCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/ClusteredCacheLoader.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- ClusteredCacheLoader.java	12 Oct 2006 23:03:57 -0000	1.14
  +++ ClusteredCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.15
  @@ -12,6 +12,8 @@
   import org.jboss.cache.Modification;
   import org.jboss.cache.RegionManager;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Dynamic;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.cache.marshall.MethodCall;
   import org.jboss.cache.marshall.MethodCallFactory;
   import org.jboss.cache.marshall.MethodDeclarations;
  @@ -37,27 +39,33 @@
    */
   public class ClusteredCacheLoader extends AbstractCacheLoader
   {
  -   protected long timeout = 10000;
      private static Log log = LogFactory.getLog(ClusteredCacheLoader.class);
   
  +   private Config config;
  +   
      /**
       * Sets the configuration.
       * A property <code>timeout</code> is used as the timeout value.
       *
       * @param props properties to use
       */
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig base)
      {
  -      try
  +      if (base instanceof Config)
         {
  -         timeout = Long.valueOf(props.getProperty("timeout")).longValue();
  +         this.config = (Config) base;
         }
  -      catch (Exception e)
  +      else
         {
  -         log.info("Using default value for config property 'timeout' - " + timeout);
  +         config = new Config(base);
         }
      }
   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
  +   }
  +
      public Set<String> getChildrenNames(Fqn fqn) throws Exception
      {
         MethodCall call = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal, fqn);
  @@ -70,7 +78,7 @@
         if (log.isTraceEnabled()) log.trace("cache=" + cache.getLocalAddress() + "; calling with " + call);
         List<Address> mbrs = cache.getMembers();
         MethodCall clusteredGet = MethodCallFactory.create(MethodDeclarations.clusteredGetMethod, call, false);
  -      List resps = cache.getRPCManager().callRemoteMethods(mbrs, clusteredGet, GroupRequest.GET_FIRST, true, timeout);
  +      List resps = cache.getRPCManager().callRemoteMethods(mbrs, clusteredGet, GroupRequest.GET_FIRST, true, config.getTimeout());
         if (resps == null)
         {
            log.error("No replies to call " + call + ".  Perhaps we're alone in the cluster?");
  @@ -240,4 +248,64 @@
      {
      }
   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      /** The serialVersionUID */
  +      private static final long serialVersionUID = -3425487656984237468L;
  +      
  +      @Dynamic
  +      private long timeout = 10000;
  +      
  +      public Config() 
  +      {
  +         setClassName(ClusteredCacheLoader.class.getName());
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {
  +         setClassName(ClusteredCacheLoader.class.getName());
  +         populateFromBaseConfig(base);
  +      }
  +
  +      public long getTimeout()
  +      {
  +         return timeout;
  +      }
  +
  +      public void setTimeout(long timeout)
  +      {
  +         testImmutability("timeout");
  +         this.timeout = timeout;
  +      }
  +      
  +      public void setProperties(Properties props)
  +      {
  +         super.setProperties(props);
  +         try
  +         {
  +            timeout = Long.valueOf(props.getProperty("timeout")).longValue();
  +         }
  +         catch (Exception e)
  +         {
  +            log.info("Using default value for config property 'timeout' - " + timeout);
  +         }
  +      }
  +
  +      public boolean equals(Object obj)
  +      {
  +         if (obj instanceof Config && equalsExcludingProperties(obj))
  +         {
  +            Config other = (Config) obj;
  +            return (this.timeout == other.timeout);
  +         }
  +         return false;
  +      }
  +
  +      public int hashCode()
  +      {
  +         return 31 * hashCodeExcludingProperties() + (int) timeout;
  +      }
  +      
  +   }
  +
   }
  
  
  
  1.20      +70 -3     JBossCache/src/org/jboss/cache/loader/FileCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FileCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/FileCacheLoader.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- FileCacheLoader.java	22 Sep 2006 16:27:56 -0000	1.19
  +++ FileCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.20
  @@ -5,6 +5,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.invocation.MarshalledValueInputStream;
   
   import java.io.File;
  @@ -23,13 +24,15 @@
    * Simple file-based CacheLoader implementation. Nodes are directories, attributes of a node is a file in the directory
    *
    * @author Bela Ban
  - * @version $Id: FileCacheLoader.java,v 1.19 2006/09/22 16:27:56 msurtani Exp $
  + * @version $Id: FileCacheLoader.java,v 1.20 2006/10/23 05:46:39 bstansberry Exp $
    */
   public class FileCacheLoader extends AbstractCacheLoader
   {
      File root = null;
      Log log = LogFactory.getLog(getClass());
   
  +   private Config config;
  +   
      /**
       * HashMap<Object,List<Modification>>. List of open transactions. Note that this is purely transient, as
       * we don't use a log, recovery is not available
  @@ -50,15 +53,29 @@
      {
      }
   
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig base)
  +   {
  +      if (base instanceof Config)
      {
  -      String location = props != null ? props.getProperty("location") : null;
  +         this.config = (Config) base;
  +      }
  +      else if (base != null)
  +      {
  +         this.config = new Config(base);
  +      }
  +         
  +      String location = this.config != null ? this.config.getLocation() : null;
         if (location != null && location.length() > 0)
         {
            root = new File(location);
         }
      }
   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
  +   }
  +
      public void create() throws Exception
      {
         if (root == null)
  @@ -348,4 +365,54 @@
         output.writeObject(attrs);
         out.close();
      }
  +   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      private static final long serialVersionUID = 4626734068542420865L;
  +      
  +      private String location;
  +
  +      public Config() 
  +      {
  +         setClassName(FileCacheLoader.class.getName());
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {
  +         setClassName(FileCacheLoader.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.3       +15 -10    JBossCache/src/org/jboss/cache/loader/AbstractDelegatingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractDelegatingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AbstractDelegatingCacheLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- AbstractDelegatingCacheLoader.java	12 Oct 2006 23:03:57 -0000	1.2
  +++ AbstractDelegatingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.3
  @@ -9,20 +9,20 @@
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.cache.RegionManager;
   
  -import java.io.ObjectInputStream;
  -import java.io.ObjectOutputStream;
  -import java.util.List;
  -import java.util.Map;
  -import java.util.Properties;
   import java.util.Set;
  +import java.util.Map;
  +import java.util.List;
  +import java.io.ObjectOutputStream;
  +import java.io.ObjectInputStream;
   
   /**
    * AbstractDelegatingCacheLoader provides standard functionality for a cache loader that simply delegates each
    * operation defined in the cache loader interface to the underlying cache loader, basically acting as a proxy to the
    * real cache loader.
  - * <p/>
  + *
    * Any cache loader implementation that extends this class would be required to override any of the methods in
    * order to provide a different or added behaviour.
    *
  @@ -47,9 +47,14 @@
         this.cacheLoader = cacheLoader;
      }
   
  -   public void setConfig(Properties properties)
  +   public void setConfig(IndividualCacheLoaderConfig config)
  +   {
  +      cacheLoader.setConfig(config);
  +   }
  +   
  +   public IndividualCacheLoaderConfig getConfig()
      {
  -      cacheLoader.setConfig(properties);
  +      return cacheLoader.getConfig();
      }
   
      public void setCache(CacheSPI c)
  
  
  
  1.21      +174 -54   JBossCache/src/org/jboss/cache/loader/AsyncCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsyncCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AsyncCacheLoader.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- AsyncCacheLoader.java	12 Oct 2006 23:03:57 -0000	1.20
  +++ AsyncCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.21
  @@ -11,6 +11,7 @@
   import org.jboss.cache.CacheException;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   
   import java.io.IOException;
   import java.util.ArrayList;
  @@ -82,21 +83,17 @@
   
      private static SynchronizedInt threadId = new SynchronizedInt(0);
   
  +
      /**
       * Default limit on entries to process asynchronously.
       */
      public static final int DEFAULT_QUEUE_SIZE = 10000;
   
  +   private Config config;
      private AsyncProcessor processor;
      private SynchronizedBoolean stopped = new SynchronizedBoolean(true);
      private BoundedLinkedQueue queue = new BoundedLinkedQueue(DEFAULT_QUEUE_SIZE);
   
  -   // Configuration keys
  -
  -   private int batchSize = 100;
  -   private long pollWait = 100; // milliseconds
  -   private boolean returnOld = true;
  -   private boolean asyncPut = true;
   
      public AsyncCacheLoader()
      {
  @@ -108,46 +105,23 @@
         super(cacheLoader);
      }
   
  -   public void setConfig(Properties props)
  -   {
  -      log.debug("setConfig " + props);
  -      String s;
  -
  -      s = props.getProperty("cache.async.batchSize");
  -      if (s != null)
  -      {
  -         batchSize = Integer.parseInt(s);
  -      }
  -      if (batchSize <= 0)
  -      {
  -         throw new IllegalArgumentException("Invalid size: " + batchSize);
  -      }
  -
  -      s = props.getProperty("cache.async.pollWait");
  -      if (s != null)
  +   public void setConfig(IndividualCacheLoaderConfig base)
         {
  -         pollWait = Integer.parseInt(s);
  -      }
  -
  -      s = props.getProperty("cache.async.returnOld");
  -      if (s != null)
  +      if (base instanceof Config)
         {
  -         returnOld = Boolean.valueOf(s).booleanValue();
  +         config = (Config) base;
         }
  -
  -      s = props.getProperty("cache.async.queueSize");
  -      if (s != null)
  +      else
         {
  -         queue = new BoundedLinkedQueue(Integer.parseInt(s));
  +         config = new Config(base);
         }
   
  -      s = props.getProperty("cache.async.put");
  -      if (s != null)
  +      if (config.getQueueSize() > 0)
         {
  -         asyncPut = Boolean.valueOf(s).booleanValue();
  +         queue = new BoundedLinkedQueue(config.getQueueSize());
         }
   
  -      super.setConfig(props);
  +      super.setConfig(base);
      }
   
      public Map get(Fqn name) throws Exception
  @@ -166,7 +140,7 @@
   
      Object get(Fqn name, Object key) throws Exception
      {
  -      if (returnOld)
  +      if (config.getReturnOld())
         {
            try
            {
  @@ -187,7 +161,7 @@
   
      public Object put(Fqn name, Object key, Object value) throws Exception
      {
  -      if (asyncPut)
  +      if (config.getUseAsyncPut())
         {
            Object oldValue = get(name, key);
            Modification mod = new Modification(Modification.ModificationType.PUT_KEY_VALUE, name, key, value);
  @@ -202,7 +176,7 @@
   
      public void put(Fqn name, Map attributes) throws Exception
      {
  -      if (asyncPut)
  +      if (config.getUseAsyncPut())
         {
            // JBCACHE-769 -- make a defensive copy
            Map attrs = (attributes == null ? null : new HashMap(attributes));
  @@ -217,7 +191,7 @@
   
      public void put(List<Modification> modifications) throws Exception
      {
  -      if (asyncPut)
  +      if (config.getUseAsyncPut())
         {
            Iterator i = modifications.iterator();
            while (i.hasNext())
  @@ -290,7 +264,7 @@
         private Thread t;
   
         // Modifications to process as a single put
  -      private final List mods = new ArrayList(batchSize);
  +      private final List mods = new ArrayList(config.getBatchSize());
   
         public void start()
         {
  @@ -356,9 +330,9 @@
            log.trace("run0");
            Object o = queue.take();
            addTaken(o);
  -         while (mods.size() < batchSize)
  +         while (mods.size() < config.getBatchSize())
            {
  -            o = queue.poll(pollWait);
  +            o = queue.poll(config.getPollWait());
               if (o == null)
               {
                  break;
  @@ -412,12 +386,158 @@
                 " delegate=[" + super.getCacheLoader() + "]" +
                 " processor=" + processor +
                 " stopped=" + stopped +
  -              " batchSize=" + batchSize +
  -              " pollWait=" + pollWait +
  -              " returnOld=" + returnOld +
  -              " asyncPut=" + asyncPut +
  +             " batchSize=" + config.getBatchSize() +
  +             " pollWait=" + config.getPollWait() +
  +             " returnOld=" + config.getReturnOld() +
  +             " asyncPut=" + config.getUseAsyncPut() +
                 " queue.capacity()=" + queue.capacity() +
                 " queue.peek()=" + queue.peek();
      }
   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      /** The serialVersionUID */
  +      private static final long serialVersionUID = 5038037589485991681L;
  +      
  +      private int batchSize = 100;
  +      private int pollWait = 100;
  +      private boolean returnOld = true;
  +      private int queueSize = 0;
  +      private boolean useAsyncPut = true;
  +      
  +      public Config()
  +      {
  +         setClassName(AsyncCacheLoader.class.getName());
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {         
  +         setClassName(AsyncCacheLoader.class.getName());
  +         populateFromBaseConfig(base);
  +      }
  +
  +      public int getBatchSize()
  +      {
  +         return batchSize;
  +      }
  +
  +      public void setBatchSize(int batchSize)
  +      {
  +         testImmutability("batchSize");
  +         this.batchSize = batchSize;
  +      }
  +
  +      public int getPollWait()
  +      {
  +         return pollWait;
  +      }
  +
  +      public void setPollWait(int pollWait)
  +      {
  +         testImmutability("pollWait");
  +         this.pollWait = pollWait;
  +      }
  +
  +      public int getQueueSize()
  +      {
  +         return queueSize;
  +      }
  +
  +      public void setQueueSize(int queueSize)
  +      {
  +         testImmutability("queueSize");
  +         this.queueSize = queueSize;
  +      }
  +
  +      public boolean getReturnOld()
  +      {
  +         return returnOld;
  +      }
  +
  +      public void setReturnOld(boolean returnOld)
  +      {
  +         testImmutability("returnOld");
  +         this.returnOld = returnOld;
  +      }
  +
  +      public boolean getUseAsyncPut()
  +      {
  +         return useAsyncPut;
  +      }
  +
  +      public void setUseAsyncPut(boolean useAsyncPut)
  +      {
  +         testImmutability("useAsyncPut");
  +         this.useAsyncPut = useAsyncPut;
  +      }
  +
  +      public void setProperties(Properties props)
  +      {
  +         super.setProperties(props);
  +         String s;
  +
  +         s = props.getProperty("cache.async.batchSize");
  +         if (s != null)
  +         {
  +            batchSize = Integer.parseInt(s);
  +         }
  +         if (batchSize <= 0)
  +         {
  +            throw new IllegalArgumentException("Invalid size: " + batchSize);
  +         }
  +
  +         s = props.getProperty("cache.async.pollWait");
  +         if (s != null)
  +         {
  +            pollWait = Integer.parseInt(s);
  +         }
  +
  +         s = props.getProperty("cache.async.returnOld");
  +         if (s != null)
  +         {
  +            returnOld = Boolean.valueOf(s).booleanValue();
  +         }
  +
  +         s = props.getProperty("cache.async.queueSize");
  +         if (s != null)
  +         {
  +            queueSize = Integer.parseInt(s);
  +         }
  +
  +         s = props.getProperty("cache.async.put");
  +         if (s != null)
  +         {
  +            useAsyncPut = Boolean.valueOf(s).booleanValue();
  +         }
  +      }
  +
  +      public boolean equals(Object obj)
  +      {
  +         if (obj instanceof Config && equalsExcludingProperties(obj))
  +         {
  +            Config other = (Config) obj;
  +            return (batchSize == other.batchSize)
  +                     && (pollWait == other.pollWait)
  +                     && (queueSize == other.queueSize)
  +                     && (returnOld == other.returnOld)
  +                     && (useAsyncPut == other.useAsyncPut);
  +         }
  +         return false;
  +      }
  +
  +      public int hashCode()
  +      {
  +         int result = hashCodeExcludingProperties();
  +         result = 31 * result + batchSize;
  +         result = 31 * result + pollWait;
  +         result = 31 * result + queueSize;
  +         result = 31 * result + (returnOld ? 0 : 1);
  +         result = 31 * result + (useAsyncPut ? 0 : 1);
  +         return result;
  +      }
  +      
  +      
  +      
  +   }
  +
   }
  
  
  
  1.13      +117 -21   JBossCache/src/org/jboss/cache/loader/RmiDelegatingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RmiDelegatingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/RmiDelegatingCacheLoader.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- RmiDelegatingCacheLoader.java	9 Oct 2006 15:36:48 -0000	1.12
  +++ RmiDelegatingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.13
  @@ -10,6 +10,7 @@
   import org.jboss.cache.DataNode;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.cache.loader.rmi.RemoteTreeCache;
   
   import java.io.ObjectInputStream;
  @@ -33,14 +34,11 @@
    * cacheloader's cache's cluster name.
    *
    * @author Daniel Gredler
  - * @version $Id: RmiDelegatingCacheLoader.java,v 1.12 2006/10/09 15:36:48 msurtani Exp $
  + * @version $Id: RmiDelegatingCacheLoader.java,v 1.13 2006/10/23 05:46:39 bstansberry Exp $
    */
   public class RmiDelegatingCacheLoader extends DelegatingCacheLoader
   {
  -
  -   private String host;
  -   private String port;
  -   private String bindName;
  +   private Config config = new Config();
      private TreeCache cache;
      private RemoteTreeCache remoteCache;
      private boolean programmaticInit;
  @@ -63,11 +61,12 @@
       */
      public RmiDelegatingCacheLoader(TreeCache cache, String host, int port, String bindName)
      {
  -      this.host = host;
  -      this.port = String.valueOf(port);
  -      this.bindName = bindName;
  -      this.tryToInitRemoteCache();
  +      this.cache = cache;
  +      config.setHost(host);
  +      config.setPort(String.valueOf(port));
  +      config.setBindName(bindName);
         this.programmaticInit = true;
  +      this.tryToInitRemoteCache();
      }
   
      /**
  @@ -75,22 +74,24 @@
       *
       * @see DelegatingCacheLoader#setConfig(java.util.Properties)
       */
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig base)
      {
  -      this.host = props.getProperty("host");
  -      if (this.host == null || this.host.length() == 0)
  +      if (base instanceof Config)
         {
  -         this.host = "localhost";
  +         this.config = (Config) base;
         }
  -      this.port = props.getProperty("port");
  -      if (this.port == null || this.port.length() == 0)
  +      else
         {
  -         this.port = "1098";
  +         config = new Config(base);
         }
  -      this.bindName = props.getProperty("bindName");
         this.tryToInitRemoteCache();
      }
   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
  +   }
  +
      /**
       * Allows configuration via XML config file.
       *
  @@ -209,13 +210,13 @@
       */
      private void tryToInitRemoteCache()
      {
  -      if (this.host == null || this.port == null || this.cache == null)
  +      if (config.getHost() == null || config.getPort() == null || this.cache == null)
         {
            return;
         }
  -      if (this.bindName == null)
  +      if (config.getBindName() == null)
         {
  -         this.bindName = this.cache.getConfiguration().getClusterName();
  +         config.setBindName(this.cache.getConfiguration().getClusterName());
         }
         if (!this.programmaticInit && this.cache.isCoordinator())
         {
  @@ -223,7 +224,7 @@
            this.remoteCache = null;
            return;
         }
  -      String name = "//" + this.host + ":" + this.port + "/" + this.bindName;
  +      String name = "//" + config.getHost() + ":" + config.getPort() + "/" + config.getBindName();
         try
         {
            this.remoteCache = (RemoteTreeCache) Naming.lookup(name);
  @@ -233,4 +234,99 @@
            log.error("Unable to lookup remote cache at '" + name + "'.", t);
         }
      }
  +   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      /** The serialVersionUID */
  +      private static final long serialVersionUID = 4578924632178739084L;
  +      
  +      private String host = "localhost";
  +      private String port = "1098";
  +      private String bindName;
  +      
  +      public Config()
  +      {
  +         setClassName(RmiDelegatingCacheLoader.class.getName());
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {
  +         setClassName(RmiDelegatingCacheLoader.class.getName());
  +         populateFromBaseConfig(base);
  +      }
  +
  +      public String getBindName()
  +      {
  +         return bindName;
  +      }
  +
  +      public void setBindName(String bindName)
  +      {
  +         testImmutability("bindName");
  +         this.bindName = bindName;
  +      }
  +
  +      public String getHost()
  +      {
  +         return host;
  +      }
  +
  +      public void setHost(String host)
  +      {
  +         testImmutability("host");
  +         this.host = host;
  +      }
  +
  +      public String getPort()
  +      {
  +         return port;
  +      }
  +
  +      public void setPort(String port)
  +      {
  +         testImmutability("port");
  +         this.port = port;
  +      }
  +
  +      public void setProperties(Properties props)
  +      {
  +         super.setProperties(props);
  +         String s = props.getProperty("host");
  +         if (s != null && s.length() > 0)
  +         {
  +            this.host = s;
  +         }
  +         s = props.getProperty("port");
  +         if (s != null && s.length() > 00)
  +         {
  +            this.port = s;
  +         }
  +         this.bindName = props.getProperty("bindName");
  +      }
  +
  +      public boolean equals(Object obj)
  +      {
  +         if (obj instanceof Config && equalsExcludingProperties(obj))
  +         {
  +            Config other = (Config) obj;
  +            
  +            return safeEquals(host, other.host)
  +                     && safeEquals(port, other.port)
  +                     && safeEquals(bindName, other.bindName);            
  +         }
  +         return false;
  +      }
  +
  +      public int hashCode()
  +      {
  +         int result = hashCodeExcludingProperties();
  +         result = 31 * result + (host == null ? 0 : host.hashCode());
  +         result = 31 * result + (port == null ? 0 : port.hashCode());
  +         result = 31 * result + (bindName == null ? 0 : bindName.hashCode());
  +         
  +         return result;
  +      }
  +      
  +      
  +   }
   }
  
  
  
  1.12      +10 -3     JBossCache/src/org/jboss/cache/loader/LocalDelegatingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalDelegatingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/LocalDelegatingCacheLoader.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- LocalDelegatingCacheLoader.java	22 Sep 2006 16:27:56 -0000	1.11
  +++ LocalDelegatingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.12
  @@ -9,12 +9,12 @@
   import org.jboss.cache.DataNode;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
   import java.util.HashMap;
   import java.util.Map;
  -import java.util.Properties;
   import java.util.Set;
   
   /**
  @@ -31,11 +31,12 @@
    *
    * @author Bela Ban
    * @author Daniel Gredler
  - * @version $Id: LocalDelegatingCacheLoader.java,v 1.11 2006/09/22 16:27:56 msurtani Exp $
  + * @version $Id: LocalDelegatingCacheLoader.java,v 1.12 2006/10/23 05:46:39 bstansberry Exp $
    */
   public class LocalDelegatingCacheLoader extends DelegatingCacheLoader
   {
   
  +   IndividualCacheLoaderConfig config;
      TreeCache delegate = null;
   
      public LocalDelegatingCacheLoader()
  @@ -47,8 +48,14 @@
         this.delegate = delegate;
      }
   
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig config)
      {
  +      this.config = config;
  +   }
  +   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
      }
   
      protected Set delegateGetChildrenNames(Fqn fqn) throws Exception
  
  
  
  1.19      +411 -116  JBossCache/src/org/jboss/cache/loader/JDBCCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JDBCCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/JDBCCacheLoader.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -b -r1.18 -r1.19
  --- JDBCCacheLoader.java	11 Oct 2006 10:02:07 -0000	1.18
  +++ JDBCCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.19
  @@ -10,6 +10,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.Modification;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.invocation.MarshalledValue;
   
   import javax.naming.InitialContext;
  @@ -80,7 +81,7 @@
    *
    * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
    * @author <a href="mailto:hmesha at novell.com">Hany Mesha </a>
  - * @version <tt>$Revision: 1.18 $</tt>
  + * @version <tt>$Revision: 1.19 $</tt>
    */
   public class JDBCCacheLoader extends AbstractCacheLoader
   {
  @@ -88,101 +89,32 @@
   
      private static final ThreadLocal connection = new ThreadLocal();
   
  -   private String driverName;
  -
  -   private String drv;
  -   private String table;
  -   private String selectChildNamesSql;
  -   private String deleteNodeSql;
  -   private String deleteAllSql;
  -   private String selectChildFqnsSql;
  -   private String insertNodeSql;
  -   private String updateNodeSql;
  -   private String selectNodeSql;
  -   private String createTableDdl;
  -   private String dropTableDdl;
  -
  -   private boolean createTable;
  -   private boolean dropTable;
  -
  -   private String datasourceName;
  +   private Config config;
      private ConnectionFactory cf;
  +   private String driverName;
   
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig base)
      {
  -      datasourceName = props.getProperty("cache.jdbc.datasource");
  -      if (datasourceName == null)
  +      if (config instanceof Config)
         {
  -         this.drv = getRequiredProperty(props, "cache.jdbc.driver");
  -         final String jdbcUrl = getRequiredProperty(props, "cache.jdbc.url");
  -         final String jdbcUsr = getRequiredProperty(props, "cache.jdbc.user");
  -         final String jdbcPwd = getRequiredProperty(props, "cache.jdbc.password");
  -
  -         if (log.isDebugEnabled())
  +         config = (Config) base;
  +      }
  +      else
            {
  -            log.debug("Properties: " +
  -                    "cache.jdbc.url=" +
  -                    jdbcUrl +
  -                    ", cache.jdbc.driver=" +
  -                    drv +
  -                    ", cache.jdbc.user=" +
  -                    jdbcUsr +
  -                    ", cache.jdbc.password=" +
  -                    jdbcPwd +
  -                    ", cache.jdbc.table=" + table);
  +         config = new Config(base);
            }
   
  -         this.cf = new NonManagedConnectionFactory(jdbcUrl, jdbcUsr, jdbcPwd);
  +      if (config.getDatasourceName() == null)
  +      {
  +         this.cf = new NonManagedConnectionFactory(config.getJdbcURL(), config.getJdbcUser(), config.getJdbcPassword());
         }
         // else we wait until the start method to do a JNDI lookup
         // of the datasource, since that's when its registered in its lifecycle
  +   }
   
  -      String prop = props.getProperty("cache.jdbc.table.create");
  -      this.createTable = (prop == null || Boolean.valueOf(prop).booleanValue());
  -      prop = props.getProperty("cache.jdbc.table.drop");
  -      this.dropTable = (prop == null || Boolean.valueOf(prop).booleanValue());
  -
  -      this.table = props.getProperty("cache.jdbc.table.name", "jbosscache");
  -      String primaryKey = props.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
  -      String fqnColumn = props.getProperty("cache.jdbc.fqn.column", "fqn");
  -      String fqnType = props.getProperty("cache.jdbc.fqn.type", "varchar(255)");
  -      String nodeColumn = props.getProperty("cache.jdbc.node.column", "node");
  -      String nodeType = props.getProperty("cache.jdbc.node.type", "blob");
  -      String parentColumn = props.getProperty("cache.jdbc.parent.column", "parent");
  -
  -      selectChildNamesSql = "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
  -      deleteNodeSql = "delete from " + table + " where " + fqnColumn + "=?";
  -      deleteAllSql = "delete from " + table;
  -      selectChildFqnsSql = "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
  -      insertNodeSql = "insert into " +
  -              table +
  -              " (" +
  -              fqnColumn +
  -              ", " +
  -              nodeColumn +
  -              ", " +
  -              parentColumn +
  -              ") values (?, ?, ?)";
  -      updateNodeSql = "update " + table + " set " + nodeColumn + "=? where " + fqnColumn + "=?";
  -      selectNodeSql = "select " + nodeColumn + " from " + table + " where " + fqnColumn + "=?";
  -
  -      createTableDdl = "create table " +
  -              table +
  -              "(" +
  -              fqnColumn +
  -              " " +
  -              fqnType +
  -              " not null, " +
  -              nodeColumn +
  -              " " +
  -              nodeType +
  -              ", " +
  -              parentColumn +
  -              " " +
  -              fqnType +
  -              ", constraint " + primaryKey + " primary key (" + fqnColumn + "))";
  -
  -      dropTableDdl = "drop table " + table;
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
      }
   
      /**
  @@ -202,11 +134,11 @@
         {
            if (log.isDebugEnabled())
            {
  -            log.debug("executing sql: " + selectChildNamesSql + " (" + fqn + ")");
  +            log.debug("executing sql: " + config.getSelectChildNamesSql() + " (" + fqn + ")");
            }
   
            con = cf.getConnection();
  -         ps = con.prepareStatement(selectChildNamesSql);
  +         ps = con.prepareStatement(config.getSelectChildNamesSql());
            ps.setString(1, fqn.toString());
            rs = ps.executeQuery();
            if (rs.next())
  @@ -394,11 +326,11 @@
            {
               if (log.isDebugEnabled())
               {
  -               log.debug("executing sql: " + deleteAllSql);
  +               log.debug("executing sql: " + config.getDeleteAllSql());
               }
   
               con = cf.getConnection();
  -            ps = con.prepareStatement(deleteAllSql);
  +            ps = con.prepareStatement(config.getDeleteAllSql());
               int deletedRows = ps.executeUpdate();
   
               if (log.isDebugEnabled())
  @@ -409,7 +341,7 @@
            else
            {
               StringBuffer sql = new StringBuffer(300);
  -            sql.append("delete from ").append(table).append(" where fqn in (");
  +            sql.append("delete from ").append(config.getTable()).append(" where fqn in (");
               //sql2.append("delete from " + table + " where fqn=? or parent in (");
               List fqns = new ArrayList();
   
  @@ -421,11 +353,11 @@
               {
                  if (log.isDebugEnabled())
                  {
  -                  log.debug("executing sql: " + deleteNodeSql + "(" + name + ")");
  +                  log.debug("executing sql: " + config.getDeleteNodeSql() + "(" + name + ")");
                  }
   
                  con = cf.getConnection();
  -               ps = con.prepareStatement(deleteNodeSql);
  +               ps = con.prepareStatement(config.getDeleteNodeSql());
                  ps.setString(1, name.toString());
               }
               else
  @@ -544,9 +476,9 @@
   
      public void start() throws Exception
      {
  -      if (drv != null)
  +      if (config.getDriverClass() != null)
         {
  -         loadDriver(drv);
  +         loadDriver(config.getDriverClass());
         }
         else
         {
  @@ -556,13 +488,13 @@
            try
            {
               ctx = new InitialContext();
  -            DataSource dataSource = (DataSource) ctx.lookup(datasourceName);
  +            DataSource dataSource = (DataSource) ctx.lookup(config.getDatasourceName());
               this.cf = new ManagedConnectionFactory(dataSource);
            }
            catch (NamingException e)
            {
  -            log.error("Failed to lookup datasource " + datasourceName + ": " + e.getMessage(), e);
  -            throw new IllegalStateException("Failed to lookup datasource " + datasourceName + ": " + e.getMessage());
  +            log.error("Failed to lookup datasource " + config.getDatasourceName() + ": " + e.getMessage(), e);
  +            throw new IllegalStateException("Failed to lookup datasource " + config.getDatasourceName() + ": " + e.getMessage());
            }
            finally
            {
  @@ -587,16 +519,16 @@
         {
            con = cf.getConnection();
            driverName = getDriverName(con);
  -         if (createTable)
  +         if (config.getCreateTable())
            {
  -            if (!tableExists(table, con))
  +            if (!tableExists(config.getTable(), con))
               {
                  if (log.isDebugEnabled())
                  {
  -                  log.debug("executing ddl: " + createTableDdl);
  +                  log.debug("executing ddl: " + config.getCreateTableDDL());
                  }
                  st = con.createStatement();
  -               st.executeUpdate(createTableDdl);
  +               st.executeUpdate(config.getCreateTableDDL());
               }
            }
         }
  @@ -609,7 +541,7 @@
   
      public void stop()
      {
  -      if (dropTable)
  +      if (config.getDropTable())
         {
            Connection con = null;
            Statement st = null;
  @@ -617,12 +549,12 @@
            {
               if (log.isDebugEnabled())
               {
  -               log.debug("executing ddl: " + dropTableDdl);
  +               log.debug("executing ddl: " + config.getDropTableDDL());
               }
   
               con = cf.getConnection();
               st = con.createStatement();
  -            st.executeUpdate(dropTableDdl);
  +            st.executeUpdate(config.getDropTableDDL());
               safeClose(st);
            }
            catch (SQLException e)
  @@ -655,11 +587,11 @@
         {
            if (log.isDebugEnabled())
            {
  -            log.debug("executing sql: " + selectChildFqnsSql + "(" + name + ")");
  +            log.debug("executing sql: " + config.getSelectChildFqnsSql() + "(" + name + ")");
            }
   
            con = cf.getConnection();
  -         selChildrenPs = con.prepareStatement(selectChildFqnsSql);
  +         selChildrenPs = con.prepareStatement(config.getSelectChildFqnsSql());
            selChildrenPs.setString(1, name);
            rs = selChildrenPs.executeQuery();
   
  @@ -736,11 +668,11 @@
         {
            if (log.isDebugEnabled())
            {
  -            log.debug("executing sql: " + insertNodeSql + " (" + name + ")");
  +            log.debug("executing sql: " + config.getInsertNodeSql() + " (" + name + ")");
            }
   
            con = cf.getConnection();
  -         ps = con.prepareStatement(insertNodeSql);
  +         ps = con.prepareStatement(config.getInsertNodeSql());
   
            ps.setString(1, name.toString());
   
  @@ -814,11 +746,11 @@
         {
            if (log.isDebugEnabled())
            {
  -            log.debug("executing sql: " + updateNodeSql);
  +            log.debug("executing sql: " + config.getUpdateNodeSql());
            }
   
            con = cf.getConnection();
  -         ps = con.prepareStatement(updateNodeSql);
  +         ps = con.prepareStatement(config.getUpdateNodeSql());
   
            if (node == null)
            {
  @@ -877,11 +809,11 @@
         {
            if (log.isDebugEnabled())
            {
  -            log.debug("executing sql: " + selectNodeSql + " (" + name + ")");
  +            log.debug("executing sql: " + config.getSelectNodeSql() + " (" + name + ")");
            }
   
            con = cf.getConnection();
  -         ps = con.prepareStatement(selectNodeSql);
  +         ps = con.prepareStatement(config.getSelectNodeSql());
            ps.setString(1, name.toString());
   
            rs = ps.executeQuery();
  @@ -1380,4 +1312,367 @@
            safeClose(con);
         }
      }
  +   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      /** The serialVersionUID */
  +      private static final long serialVersionUID = -5923661816427361643L;
  +      
  +      private boolean createTable;
  +      private String createTableDDL;
  +      private String datasourceName;
  +      private String deleteAllSql;
  +      private String deleteNodeSql;
  +      private boolean dropTable;
  +      private String dropTableDDL;
  +      private String driverClass;
  +      private String insertNodeSql;
  +      private String jdbcURL;
  +      private String jdbcUser;
  +      private String jdbcPassword;
  +      private String selectChildFqnsSql;
  +      private String selectChildNamesSql;
  +      private String selectNodeSql;
  +      private String table;
  +      private String updateNodeSql;
  +      private String updateTableSql;      
  +      
  +      public Config() 
  +      {
  +         setClassName(JDBCCacheLoader.class.getName());         
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {
  +         setClassName(JDBCCacheLoader.class.getName());
  +         populateFromBaseConfig(base);
  +      }
  +
  +      public boolean getCreateTable()
  +      {
  +         return createTable;
  +      }
  +
  +      public void setCreateTable(boolean createTable)
  +      {
  +         testImmutability("createTable");
  +         this.createTable = createTable;
  +      }
  +
  +      public String getCreateTableDDL()
  +      {
  +         return createTableDDL;
  +      }
  +
  +      public void setCreateTableDDL(String createTableDDL)
  +      {
  +         testImmutability("createTableDDL");
  +         this.createTableDDL = createTableDDL;
  +      }
  +
  +      public String getDatasourceName()
  +      {
  +         return datasourceName;
  +      }
  +
  +      public void setDatasourceName(String datasourceName)
  +      {
  +         testImmutability("datasourceName");
  +         this.datasourceName = datasourceName;
  +      }
  +
  +      public String getDeleteAllSql()
  +      {
  +         return deleteAllSql;
  +      }
  +
  +      public void setDeleteAllSql(String deleteAllSql)
  +      {
  +         testImmutability("deleteAllSql");
  +         this.deleteAllSql = deleteAllSql;
  +      }
  +
  +      public String getDeleteNodeSql()
  +      {
  +         return deleteNodeSql;
  +      }
  +
  +      public void setDeleteNodeSql(String deleteNodeSql)
  +      {
  +         testImmutability("deleteNodeSql");
  +         this.deleteNodeSql = deleteNodeSql;
  +      }
  +
  +      public String getDriverClass()
  +      {
  +         return driverClass;
  +      }
  +
  +      public void setDriverClass(String driverClass)
  +      {
  +         testImmutability("driverClass");
  +         this.driverClass = driverClass;
  +      }
  +
  +      public boolean getDropTable()
  +      {
  +         return dropTable;
  +      }
  +
  +      public void setDropTable(boolean dropTable)
  +      {
  +         testImmutability("dropTable");
  +         this.dropTable = dropTable;
  +      }
  +
  +      public String getInsertNodeSql()
  +      {
  +         return insertNodeSql;
  +      }
  +
  +      public void setInsertNodeSql(String insertNodeSql)
  +      {
  +         testImmutability("insertNodeSql");
  +         this.insertNodeSql = insertNodeSql;
  +      }
  +
  +      public String getSelectChildFqnsSql()
  +      {
  +         return selectChildFqnsSql;
  +      }
  +
  +      public void setSelectChildFqnsSql(String selectChildFqnsSql)
  +      {
  +         testImmutability("selectChildFqnsSql");
  +         this.selectChildFqnsSql = selectChildFqnsSql;
  +      }
  +
  +      public String getSelectNodeSql()
  +      {
  +         return selectNodeSql;
  +      }
  +
  +      public void setSelectNodeSql(String selectNodeSql)
  +      {
  +         testImmutability("selectNodeSql");
  +         this.selectNodeSql = selectNodeSql;
  +      }
  +
  +      public String getTable()
  +      {
  +         return table;
  +      }
  +
  +      public void setTable(String table)
  +      {
  +         testImmutability("table");
  +         this.table = table;
  +      }
  +
  +      public String getUpdateTableSql()
  +      {
  +         return updateTableSql;
  +      }
  +
  +      public void setUpdateTableSql(String updateTableSql)
  +      {
  +         testImmutability("updateTableSql");
  +         this.updateTableSql = updateTableSql;
  +      }     
  +      
  +      public String getDropTableDDL()
  +      {
  +         return dropTableDDL;
  +      }
  +
  +      public void setDropTableDDL(String dropTableDDL)
  +      {
  +         testImmutability("dropTableDDL");
  +         this.dropTableDDL = dropTableDDL;
  +      }
  +
  +      public String getSelectChildNamesSql()
  +      {
  +         return selectChildNamesSql;
  +      }
  +
  +      public void setSelectChildNamesSql(String selectChildNamesSql)
  +      {
  +         testImmutability("selectChildNamesSql");
  +         this.selectChildNamesSql = selectChildNamesSql;
  +      }
  +
  +      public String getUpdateNodeSql()
  +      {
  +         return updateNodeSql;
  +      }
  +
  +      public void setUpdateNodeSql(String updateNodeSql)
  +      {
  +         testImmutability("updateNodeSql");
  +         this.updateNodeSql = updateNodeSql;
  +      }
  +      
  +      public String getJdbcPassword()
  +      {
  +         return jdbcPassword;
  +      }
  +
  +      public void setJdbcPassword(String jdbcPassword)
  +      {
  +         testImmutability("jdbcPassword");
  +         this.jdbcPassword = jdbcPassword;
  +      }
  +
  +      public String getJdbcURL()
  +      {
  +         return jdbcURL;
  +      }
  +
  +      public void setJdbcURL(String jdbcURL)
  +      {
  +         testImmutability("jdbcURL");
  +         this.jdbcURL = jdbcURL;
  +      }
  +
  +      public String getJdbcUser()
  +      {
  +         return jdbcUser;
  +      }
  +
  +      public void setJdbcUser(String jdbcUser)
  +      {
  +         testImmutability("jdbcUser");
  +         this.jdbcUser = jdbcUser;
  +      }
  +
  +      public void setProperties(Properties props)
  +      {
  +         super.setProperties(props);
  +         datasourceName = props.getProperty("cache.jdbc.datasource");
  +         if (datasourceName == null)
  +         {
  +            this.driverClass = getRequiredProperty(props, "cache.jdbc.driver");
  +            this.jdbcURL = getRequiredProperty(props, "cache.jdbc.url");
  +            this.jdbcUser = getRequiredProperty(props, "cache.jdbc.user");
  +            this.jdbcPassword = getRequiredProperty(props, "cache.jdbc.password");
  +
  +            if (log.isDebugEnabled())
  +            {
  +               log.debug("Properties: " +
  +                       "cache.jdbc.url=" +
  +                       jdbcURL +
  +                       ", cache.jdbc.driver=" +
  +                       driverClass +
  +                       ", cache.jdbc.user=" +
  +                       jdbcUser +
  +                       ", cache.jdbc.password=" +
  +                       jdbcPassword +
  +                       ", cache.jdbc.table=" + table);
  +            }
  +         }
  +
  +         String prop = props.getProperty("cache.jdbc.table.create");
  +         this.createTable = (prop == null || Boolean.valueOf(prop).booleanValue());
  +         prop = props.getProperty("cache.jdbc.table.drop");
  +         this.dropTable = (prop == null || Boolean.valueOf(prop).booleanValue());
  +
  +         this.table = props.getProperty("cache.jdbc.table.name", "jbosscache");
  +         String primaryKey = props.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
  +         String fqnColumn = props.getProperty("cache.jdbc.fqn.column", "fqn");
  +         String fqnType = props.getProperty("cache.jdbc.fqn.type", "varchar(255)");
  +         String nodeColumn = props.getProperty("cache.jdbc.node.column", "node");
  +         String nodeType = props.getProperty("cache.jdbc.node.type", "blob");
  +         String parentColumn = props.getProperty("cache.jdbc.parent.column", "parent");
  +
  +         selectChildNamesSql = "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
  +         deleteNodeSql = "delete from " + table + " where " + fqnColumn + "=?";
  +         deleteAllSql = "delete from " + table;
  +         selectChildFqnsSql = "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
  +         insertNodeSql = "insert into " +
  +                 table +
  +                 " (" +
  +                 fqnColumn +
  +                 ", " +
  +                 nodeColumn +
  +                 ", " +
  +                 parentColumn +
  +                 ") values (?, ?, ?)";
  +         updateNodeSql = "update " + table + " set " + nodeColumn + "=? where " + fqnColumn + "=?";
  +         selectNodeSql = "select " + nodeColumn + " from " + table + " where " + fqnColumn + "=?";
  +
  +         createTableDDL = "create table " +
  +                 table +
  +                 "(" +
  +                 fqnColumn +
  +                 " " +
  +                 fqnType +
  +                 " not null, " +
  +                 nodeColumn +
  +                 " " +
  +                 nodeType +
  +                 ", " +
  +                 parentColumn +
  +                 " " +
  +                 fqnType +
  +                 ", constraint " + primaryKey + " primary key (" + fqnColumn + "))";
  +
  +         dropTableDDL = "drop table " + table;
  +      }
  +
  +      public boolean equals(Object obj)
  +      {
  +         if (obj instanceof Config && equalsExcludingProperties(obj))
  +         {         
  +            Config other = (Config) obj;
  +            
  +            return (this.createTable == other.createTable)
  +                   && safeEquals(createTableDDL, other.createTableDDL)
  +                   && safeEquals(datasourceName, other.datasourceName)
  +                   && safeEquals(deleteAllSql, other.deleteAllSql)
  +                   && safeEquals(deleteNodeSql, other.deleteNodeSql)
  +                   && safeEquals(driverClass, other.driverClass)
  +                   && (dropTable == other.dropTable)
  +                   && safeEquals(dropTableDDL, other.dropTableDDL)
  +                   && safeEquals(insertNodeSql, other.insertNodeSql)
  +                   && safeEquals(jdbcPassword, other.jdbcPassword)
  +                   && safeEquals(jdbcURL, other.jdbcURL)
  +                   && safeEquals(jdbcUser, other.jdbcUser)
  +                   && safeEquals(selectChildFqnsSql, other.selectChildFqnsSql)
  +                   && safeEquals(selectChildNamesSql, other.selectChildNamesSql)
  +                   && safeEquals(selectNodeSql, other.selectNodeSql)
  +                   && safeEquals(table, other.table)
  +                   && safeEquals(updateNodeSql, other.updateNodeSql)
  +                   && safeEquals(updateTableSql, other.updateTableSql);
  +         }
  +         
  +         return false;
  +      }
  +      
  +      public int hashCode()
  +      {
  +         int result = hashCodeExcludingProperties();
  +         result = 31 * result + (createTable ? 0 : 1);
  +         result = 31 * result + (createTableDDL == null ? 0 : createTableDDL.hashCode());
  +         result = 31 * result + (datasourceName == null ? 0 : datasourceName.hashCode());
  +         result = 31 * result + (deleteAllSql == null ? 0 : deleteAllSql.hashCode());
  +         result = 31 * result + (deleteNodeSql == null ? 0 : deleteNodeSql.hashCode());
  +         result = 31 * result + (driverClass == null ? 0 : driverClass.hashCode());
  +         result = 31 * result + (dropTable ? 0 : 1);
  +         result = 31 * result + (dropTableDDL == null ? 0 : dropTableDDL.hashCode());
  +         result = 31 * result + (insertNodeSql == null ? 0 : insertNodeSql.hashCode());
  +         result = 31 * result + (jdbcPassword == null ? 0 : jdbcPassword.hashCode());
  +         result = 31 * result + (jdbcUser == null ? 0 : jdbcUser.hashCode());
  +         result = 31 * result + (jdbcURL == null ? 0 : jdbcURL.hashCode());
  +         result = 31 * result + (selectChildFqnsSql == null ? 0 : selectChildFqnsSql.hashCode());
  +         result = 31 * result + (selectChildNamesSql == null ? 0 : selectChildNamesSql.hashCode());
  +         result = 31 * result + (selectNodeSql == null ? 0 : selectNodeSql.hashCode());
  +         result = 31 * result + (table == null ? 0 : table.hashCode());
  +         result = 31 * result + (updateNodeSql == null ? 0 : updateNodeSql.hashCode());
  +         result = 31 * result + (updateTableSql == null ? 0 : updateTableSql.hashCode());
  +         
  +         return result;
  +      }     
  +      
  +   }
   }
  
  
  
  1.12      +77 -8     JBossCache/src/org/jboss/cache/loader/RpcDelegatingCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RpcDelegatingCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/RpcDelegatingCacheLoader.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- RpcDelegatingCacheLoader.java	22 Sep 2006 16:27:56 -0000	1.11
  +++ RpcDelegatingCacheLoader.java	23 Oct 2006 05:46:39 -0000	1.12
  @@ -10,6 +10,8 @@
   import org.jboss.cache.DataNode;
   import org.jboss.cache.Fqn;
   import org.jboss.cache.TreeCache;
  +import org.jboss.cache.config.Dynamic;
  +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
   import org.jboss.cache.lock.TimeoutException;
   import org.jboss.cache.marshall.MethodCall;
   import org.jboss.cache.marshall.MethodCallFactory;
  @@ -34,12 +36,12 @@
    * specified, it defaults to <tt>5000</tt>.
    *
    * @author Daniel Gredler
  - * @version $Id: RpcDelegatingCacheLoader.java,v 1.11 2006/09/22 16:27:56 msurtani Exp $
  + * @version $Id: RpcDelegatingCacheLoader.java,v 1.12 2006/10/23 05:46:39 bstansberry Exp $
    */
   public class RpcDelegatingCacheLoader extends DelegatingCacheLoader
   {
   
  -   private int timeout;
  +   private Config config = new Config();
      private Address localAddress;
   
      public static final Method METHOD_GET_STATE;
  @@ -96,7 +98,7 @@
      public RpcDelegatingCacheLoader(CacheSPI cache, int timeout)
      {
         setCache(cache);
  -      this.timeout = timeout;
  +      config.setTimeout(timeout);
      }
   
      /**
  @@ -104,11 +106,21 @@
       *
       * @see DelegatingCacheLoader#setConfig(java.util.Properties)
       */
  -   public void setConfig(Properties props)
  +   public void setConfig(IndividualCacheLoaderConfig base)
      {
  -      if (props == null) return;
  -      String t = props.getProperty("timeout");
  -      this.timeout = (t == null || t.length() == 0 ? 5000 : Integer.parseInt(t));
  +      if (base instanceof Config)
  +      {
  +         this.config = (Config) base;
  +      }
  +      else
  +      { 
  +         this.config = new Config(base);
  +      }
  +   }
  +   
  +   public IndividualCacheLoaderConfig getConfig()
  +   {
  +      return config;
      }
   
      /**
  @@ -252,7 +264,7 @@
         MethodCall methodCall = MethodCallFactory.create(method, args);
         boolean synchronous = true;
         boolean excludeSelf = true;
  -      List responses = cache.getRPCManager().callRemoteMethods(members, methodCall, synchronous, excludeSelf, this.timeout);
  +      List responses = cache.getRPCManager().callRemoteMethods(members, methodCall, synchronous, excludeSelf, config.getTimeout());
         if (responses == null)
         {
            throw new Exception("Remote method call [" + cache.getLocalAddress() + "]->[" + coordinator + "]." + methodCall.getMethod().getName() + "() was discarded!");
  @@ -268,4 +280,61 @@
         }
         return response;
      }
  +   
  +   public static class Config extends IndividualCacheLoaderConfig
  +   {
  +      /** The serialVersionUID */
  +      private static final long serialVersionUID = -3425487656984237468L;
  +      
  +      @Dynamic
  +      private int timeout = 5000;
  +      
  +      public Config() 
  +      {
  +         setClassName(RpcDelegatingCacheLoader.class.getName());
  +      }
  +      
  +      private Config(IndividualCacheLoaderConfig base)
  +      {
  +         setClassName(RpcDelegatingCacheLoader.class.getName());
  +         populateFromBaseConfig(base);
  +      }
  +
  +      public int getTimeout()
  +      {
  +         return timeout;
  +      }
  +
  +      public void setTimeout(int timeout)
  +      {
  +         testImmutability("timeout");
  +         this.timeout = timeout;
  +      }
  +      
  +      public void setProperties(Properties props)
  +      {
  +         if (props == null) return;
  +         
  +         super.setProperties(props);
  +         String t = props.getProperty("timeout");
  +         if (t != null && t.length() > 0)
  +            this.timeout = Integer.parseInt(t);
  +      }
  +
  +      public boolean equals(Object obj)
  +      {
  +         if (obj instanceof Config && equalsExcludingProperties(obj))
  +         {
  +            Config other = (Config) obj;
  +            return (this.timeout == other.timeout);
  +         }
  +         return false;
  +      }
  +
  +      public int hashCode()
  +      {
  +         return 31 * hashCodeExcludingProperties() + (int) timeout;
  +      }
  +      
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list