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

Brian Stansberry brian.stansberry at jboss.com
Sat Nov 11 11:29:31 EST 2006


  User: bstansberry
  Date: 06/11/11 11:29:31

  Modified:    src/org/jboss/cache/config  Configuration.java
  Log:
  Add a static converter from the old legacy cache mode int to the enum
  
  Revision  Changes    Path
  1.27      +22 -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.26
  retrieving revision 1.27
  diff -u -b -r1.26 -r1.27
  --- Configuration.java	10 Nov 2006 05:59:22 -0000	1.26
  +++ Configuration.java	11 Nov 2006 16:29:31 -0000	1.27
  @@ -28,7 +28,28 @@
       */
      public enum CacheMode
      {
  -      LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC, INVALIDATION_ASYNC }
  +      LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC, INVALIDATION_ASYNC 
  +   }
  +
  +   public static CacheMode legacyModeToCacheMode(int legacyMode)
  +   {
  +      switch(legacyMode)
  +      {
  +         case 1:
  +            return CacheMode.LOCAL;
  +         case 2:
  +            return CacheMode.REPL_ASYNC;
  +         case 3:
  +            return CacheMode.REPL_SYNC;
  +         case 4:
  +            return CacheMode.INVALIDATION_ASYNC;
  +         case 5:
  +            return CacheMode.INVALIDATION_SYNC;
  +         default:
  +            throw new IllegalArgumentException("Unknown legacy cache mode " + 
  +                                               legacyMode);
  +      }
  +   }
   
      /**
       * Public enum that encapsulates node locking scheme
  
  
  



More information about the jboss-cvs-commits mailing list