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

Manik Surtani msurtani at jboss.com
Fri Sep 22 13:04:49 EDT 2006


  User: msurtani
  Date: 06/09/22 13:04:49

  Modified:    src/org/jboss/cache/interceptors  CacheStoreInterceptor.java
  Log:
  Fixed move-related issues
  
  Revision  Changes    Path
  1.34      +19 -8     JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheStoreInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheStoreInterceptor.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -b -r1.33 -r1.34
  --- CacheStoreInterceptor.java	22 Sep 2006 16:27:55 -0000	1.33
  +++ CacheStoreInterceptor.java	22 Sep 2006 17:04:49 -0000	1.34
  @@ -26,7 +26,7 @@
    * through the CacheLoader, either after each method call (no TXs), or at TX commit.
    *
    * @author Bela Ban
  - * @version $Id: CacheStoreInterceptor.java,v 1.33 2006/09/22 16:27:55 msurtani Exp $
  + * @version $Id: CacheStoreInterceptor.java,v 1.34 2006/09/22 17:04:49 msurtani Exp $
    */
   public class CacheStoreInterceptor extends BaseCacheLoaderInterceptor implements CacheStoreInterceptorMBean
   {
  @@ -389,35 +389,46 @@
         }
   
         args = methodCall.getArgs();
  +      Modification mod = null;
         switch (methodCall.getMethodId())
         {
            case MethodDeclarations.putDataMethodLocal_id:
  -            return new Modification(Modification.ModificationType.PUT_DATA,
  +            mod = new Modification(Modification.ModificationType.PUT_DATA,
                       (Fqn) args[1],      // fqn
                       (Map) args[2]);     // data
  +            break;
            case MethodDeclarations.putDataEraseMethodLocal_id:
  -            return new Modification(Modification.ModificationType.PUT_DATA_ERASE,
  +            mod = new Modification(Modification.ModificationType.PUT_DATA_ERASE,
                       (Fqn) args[1],      // fqn
                       (Map) args[2]);     // data
  +            break;
            case MethodDeclarations.putKeyValMethodLocal_id:
  -            return new Modification(Modification.ModificationType.PUT_KEY_VALUE,
  +            mod = new Modification(Modification.ModificationType.PUT_KEY_VALUE,
                       (Fqn) args[1],      // fqn
                       args[2],           // key
                       args[3]);          // value
  +            break;
            case MethodDeclarations.removeNodeMethodLocal_id:
  -            return new Modification(Modification.ModificationType.REMOVE_NODE,
  +            mod = new Modification(Modification.ModificationType.REMOVE_NODE,
                       (Fqn) args[1]);     // fqn
  +            break;
            case MethodDeclarations.removeKeyMethodLocal_id:
  -            return new Modification(Modification.ModificationType.REMOVE_KEY_VALUE,
  +            mod = new Modification(Modification.ModificationType.REMOVE_KEY_VALUE,
                       (Fqn) args[1],      // fqn
                       args[2]);          // key
  +            break;
            case MethodDeclarations.removeDataMethodLocal_id:
  -            return new Modification(Modification.ModificationType.REMOVE_DATA,
  +            mod = new Modification(Modification.ModificationType.REMOVE_DATA,
                       (Fqn) args[1]);     // fqn
  +            break;
            case MethodDeclarations.moveMethodLocal_id:
  -            return new Modification(Modification.ModificationType.MOVE, (Fqn) args[0], (Fqn) args[1]);
  +            mod = new Modification(Modification.ModificationType.MOVE, (Fqn) args[0], (Fqn) args[1]);
  +            break;
            default :
               throw new CacheException("method call " + method.getName() + " cannot be converted to a modification");
         }
  +
  +      if (log.isTraceEnabled()) log.trace("Converted " + methodCall + " to Modification of type " + mod.getType());
  +      return mod;
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list