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

Manik Surtani msurtani at jboss.com
Mon Aug 14 19:02:54 EDT 2006


  User: msurtani
  Date: 06/08/14 19:02:54

  Modified:    src/org/jboss/cache/config  Configuration.java
  Log:
  Converted NodeLockingScheme, IsolationLevel and LockType to enums
  
  Revision  Changes    Path
  1.13      +14 -6     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.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- Configuration.java	14 Aug 2006 17:52:34 -0000	1.12
  +++ Configuration.java	14 Aug 2006 23:02:54 -0000	1.13
  @@ -72,7 +72,7 @@
   
       private long syncReplTimeout = 15000;
       private String evictionPolicyClass = null;
  -    private CacheMode cacheModeInt = CacheMode.LOCAL;
  +    private CacheMode cacheMode = CacheMode.LOCAL;
       private boolean inactiveOnStartup = false;
   
       private long initialStateRetrievalTimeout = 10000;
  @@ -299,17 +299,23 @@
   
       public CacheMode getCacheMode()
       {
  -        return cacheModeInt;
  +        return cacheMode;
       }
   
       public void setCacheMode(CacheMode cacheModeInt)
       {
  -        this.cacheModeInt = cacheModeInt;
  +        this.cacheMode = cacheModeInt;
       }
   
       public void setCacheMode(String cacheMode)
       {
  -        this.cacheModeInt = CacheMode.valueOf(cacheMode);
  +        if (cacheMode == null) throw new ConfigurationException("Cache mode cannot be null", "CacheMode");
  +        this.cacheMode = CacheMode.valueOf(cacheMode.toUpperCase());
  +        if (this.cacheMode == null)
  +        {
  +            log.warn("Unknown cache mode '"+cacheMode+"', using defaults.");
  +            this.cacheMode = CacheMode.LOCAL;
  +        }
       }
   
       public boolean isInactiveOnStartup()
  @@ -433,7 +439,8 @@
   
       public void setNodeLockingScheme(String nodeLockingScheme)
       {
  -        this.nodeLockingScheme = NodeLockingScheme.valueOf(nodeLockingScheme);
  +        if (nodeLockingScheme == null) throw new ConfigurationException("Node locking scheme cannot be null", "NodeLockingScheme");
  +        this.nodeLockingScheme = NodeLockingScheme.valueOf(nodeLockingScheme.toUpperCase());
           if (this.nodeLockingScheme == null)
           {
               log.warn("Unknown node locking scheme '"+nodeLockingScheme+"', using defaults.");
  @@ -443,7 +450,8 @@
   
       public void setIsolationLevel(String isolationLevel)
       {
  -        this.isolationLevel = IsolationLevel.valueOf(isolationLevel);
  +        if (isolationLevel == null) throw new ConfigurationException("Isolation level cannot be null", "IsolationLevel");
  +        this.isolationLevel = IsolationLevel.valueOf(isolationLevel.toUpperCase());
           if (this.isolationLevel == null)
           {
               log.warn("Unknown isolation level '"+isolationLevel+"', using defaults.");
  
  
  



More information about the jboss-cvs-commits mailing list