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

Manik Surtani msurtani at jboss.com
Wed Sep 13 12:02:17 EDT 2006


  User: msurtani
  Date: 06/09/13 12:02:17

  Modified:    src/org/jboss/cache/config  Configuration.java
  Log:
  Made Cloneable and Serializable
  
  Revision  Changes    Path
  1.19      +26 -1     JBossCache/src/org/jboss/cache/config/Configuration.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Configuration.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/config/Configuration.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -b -r1.18 -r1.19
  --- Configuration.java	13 Sep 2006 15:53:04 -0000	1.18
  +++ Configuration.java	13 Sep 2006 16:02:17 -0000	1.19
  @@ -16,12 +16,14 @@
   import org.w3c.dom.NamedNodeMap;
   import org.w3c.dom.NodeList;
   
  +import java.io.Serializable;
  +
   /**
    * Implementation of the Configuration interface.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
  -public class Configuration
  +public class Configuration implements Serializable, Cloneable
   {
      private Log log = LogFactory.getLog(Configuration.class);
      private TreeCache cache; // back-reference to test whether the cache is running.
  @@ -287,7 +289,9 @@
         testImmutability("nodeLockingScheme");
         testImmutability("nodeLockingOptimistic");
         if (nodeLockingScheme == null)
  +      {
            throw new ConfigurationException("Node locking scheme cannot be null", "NodeLockingScheme");
  +      }
         this.nodeLockingScheme = NodeLockingScheme.valueOf(nodeLockingScheme.toUpperCase());
         if (this.nodeLockingScheme == null)
         {
  @@ -548,8 +552,10 @@
         try
         {
            if (cache != null && cache.started && !getClass().getDeclaredField(fieldName).isAnnotationPresent(Dynamic.class))
  +         {
               throw new ConfigurationException("Attempted to modify a non-Dymnamic configuration element after the cache has started!");
         }
  +      }
         catch (NoSuchFieldException e)
         {
            log.warn("Field " + fieldName + " not found!!");
  @@ -593,23 +599,35 @@
         if (useRegionBasedMarshalling != that.useRegionBasedMarshalling) return false;
         if (useReplQueue != that.useReplQueue) return false;
         if (buddyReplicationConfig != null ? !buddyReplicationConfig.equals(that.buddyReplicationConfig) : that.buddyReplicationConfig != null)
  +      {
            return false;
  +      }
         if (cacheLoaderConfiguration != null ? !cacheLoaderConfiguration.equals(that.cacheLoaderConfiguration) : that.cacheLoaderConfiguration != null)
  +      {
            return false;
  +      }
         if (cacheMode != that.cacheMode) return false;
         if (clusterConfig != null ? !clusterConfig.equals(that.clusterConfig) : that.clusterConfig != null) return false;
         if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
         if (evictionPolicyClass != null ? !evictionPolicyClass.equals(that.evictionPolicyClass) : that.evictionPolicyClass != null)
  +      {
            return false;
  +      }
         if (evictionPolicyConfig != null ? !evictionPolicyConfig.equals(that.evictionPolicyConfig) : that.evictionPolicyConfig != null)
  +      {
            return false;
  +      }
         if (isolationLevel != that.isolationLevel) return false;
         if (muxServiceName != null ? !muxServiceName.equals(that.muxServiceName) : that.muxServiceName != null)
  +      {
            return false;
  +      }
         if (muxStackName != null ? !muxStackName.equals(that.muxStackName) : that.muxStackName != null) return false;
         if (nodeLockingScheme != that.nodeLockingScheme) return false;
         if (transactionManagerLookupClass != null ? !transactionManagerLookupClass.equals(that.transactionManagerLookupClass) : that.transactionManagerLookupClass != null)
  +      {
            return false;
  +      }
   
         return true;
      }
  @@ -645,4 +663,11 @@
         result = 29 * result + (muxStackName != null ? muxStackName.hashCode() : 0);
         return result;
      }
  +
  +   public Configuration clone() throws CloneNotSupportedException
  +   {
  +      Configuration c = (Configuration) super.clone();
  +      c.setTreeCache(null);
  +      return c;
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list