[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/loader ...

Manik Surtani manik at jboss.org
Tue Jul 17 13:22:12 EDT 2007


  User: msurtani
  Date: 07/07/17 13:22:12

  Modified:    tests/functional/org/jboss/cache/loader  
                        DummyInMemoryCacheLoader.java DummyCacheLoader.java
  Log:
  JBCACHE-1134
  
  Revision  Changes    Path
  1.12      +5 -50     JBossCache/tests/functional/org/jboss/cache/loader/DummyInMemoryCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DummyInMemoryCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/DummyInMemoryCacheLoader.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- DummyInMemoryCacheLoader.java	17 Jul 2007 02:03:26 -0000	1.11
  +++ DummyInMemoryCacheLoader.java	17 Jul 2007 17:22:12 -0000	1.12
  @@ -178,51 +178,6 @@
         nodes.put(fqn, n);
      }
   
  -
  -   public void prepare(Object tx, List<Modification> modifications, boolean one_phase) throws Exception
  -   {
  -      if (one_phase)
  -      {
  -         put(modifications);
  -      }
  -      else
  -      {
  -         transactions.put(tx, modifications);
  -      }
  -   }
  -
  -   public void commit(Object tx) throws Exception
  -   {
  -      List<Modification> modifications = transactions.remove(tx);
  -      if (modifications == null)
  -      {
  -         throw new Exception("transaction " + tx + " not found in transaction table");
  -      }
  -      put(modifications);
  -   }
  -
  -   public void rollback(Object tx)
  -   {
  -      transactions.remove(tx);
  -   }
  -
  -   public void create() throws Exception
  -   {
  -   }
  -
  -   public void start() throws Exception
  -   {
  -   }
  -
  -   public void stop()
  -   {
  -   }
  -
  -   public void destroy()
  -   {
  -   }
  -
  -
      public class DummyNode
      {
         Map data = new HashMap();
  
  
  
  1.9       +5 -76     JBossCache/tests/functional/org/jboss/cache/loader/DummyCacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DummyCacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/loader/DummyCacheLoader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- DummyCacheLoader.java	24 May 2007 18:13:59 -0000	1.8
  +++ DummyCacheLoader.java	17 Jul 2007 17:22:12 -0000	1.9
  @@ -13,7 +13,6 @@
   
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
  -import java.util.HashMap;
   import java.util.List;
   import java.util.Map;
   import java.util.Set;
  @@ -26,7 +25,6 @@
   public class DummyCacheLoader extends AbstractCacheLoader
   {
      private int getChildrenNamesCount = 0, getCount = 0, putCount = 0, existsCount = 0, removeCount = 0;
  -   private Map m_transactions = new HashMap();
   
      public int getGetChildrenNamesCount()
      {
  @@ -196,101 +194,32 @@
         removeCount++;
      }
   
  -   /**
  -    * Prepare the modifications. For example, for a DB-based CacheLoader:
  -    * <ol>
  -    * <li>Create a local (JDBC) transaction
  -    * <li>Associate the local transaction with <code>tx</code> (tx is the key)
  -    * <li>Execute the coresponding SQL statements against the DB (statements derived from modifications)
  -    * </ol>
  -    * For non-transactional CacheLoader (e.g. file-based), this could be a null operation
  -    *
  -    * @param tx            The transaction, just used as a hashmap key
  -    * @param modifications List<Modification>, a list of all modifications within the given transaction
  -    * @param one_phase     Persist immediately and (for example) commit the local JDBC transaction as well. When true,
  -    *                      we won't get a {@link #commit(Object)} or {@link #rollback(Object)} method call later
  -    * @throws Exception
  -    */
  -   public void prepare(Object tx, List<Modification> modifications, boolean one_phase) throws Exception
  -   {
  -      if (one_phase)
  -      {
  -         put(modifications);
  -      }
  -      else
  -      {
  -         m_transactions.put(tx, modifications);
  -      }
  -   }
  -
  -   /**
  -    * Commit the transaction. A DB-based CacheLoader would look up the local JDBC transaction asociated
  -    * with <code>tx</code> and commit that transaction<br/>
  -    * Non-transactional CacheLoaders could simply write the data that was previously saved transiently under the
  -    * given <code>tx</code> key, to (for example) a file system (note this only holds if the previous prepare() did
  -    * not define one_phase=true
  -    *
  -    * @param tx
  -    */
  -   public void commit(Object tx) throws Exception
  -   {
  -      List modifications = (List) m_transactions.get(tx);
  -      if (modifications == null)
  -      {
  -         return;
  -      }
  -      put(modifications);
  -      m_transactions.remove(tx);
  -   }
  -
  -   /**
  -    * Roll the transaction back. A DB-based CacheLoader would look up the local JDBC transaction asociated
  -    * with <code>tx</code> and roll back that transaction
  -    *
  -    * @param tx
  -    */
  -   public void rollback(Object tx)
  -   {
  -      List modifications = (List) m_transactions.get(tx);
  -      if (modifications == null)
  -      {
  -         return;
  -      }
  -      m_transactions.remove(tx);
  -   }
  -
  +   @Override
      public void loadEntireState(ObjectOutputStream os) throws Exception
      {
         //intentional no-op      
      }
   
  +   @Override
      public void loadState(Fqn subtree, ObjectOutputStream os) throws Exception
      {
         // intentional no-op      
      }
   
  +   @Override
      public void storeEntireState(ObjectInputStream is) throws Exception
      {
         // intentional no-op      
      }
   
  +   @Override
      public void storeState(Fqn subtree, ObjectInputStream is) throws Exception
      {
         // intentional no-op      
      }
   
  -   public void create() throws Exception
  -   {
  -   }
  -
  -   public void start() throws Exception
  -   {
  -   }
  -
  -   public void stop()
  -   {
  -   }
   
  +   @Override
      public void destroy()
      {
         getChildrenNamesCount = 0;
  
  
  



More information about the jboss-cvs-commits mailing list