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

Manik Surtani msurtani at jboss.com
Fri Sep 22 12:56:43 EDT 2006


  User: msurtani
  Date: 06/09/22 12:56:43

  Modified:    tests/functional/org/jboss/cache/loader 
                        DummyInMemoryCacheLoader.java
  Log:
  added tx capabilities
  
  Revision  Changes    Path
  1.3       +16 -0     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.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- DummyInMemoryCacheLoader.java	19 Sep 2006 13:52:33 -0000	1.2
  +++ DummyInMemoryCacheLoader.java	22 Sep 2006 16:56:43 -0000	1.3
  @@ -27,6 +27,7 @@
   {
      private Map<Fqn, Node> nodes = new HashMap<Fqn, Node>();
      private Log log = LogFactory.getLog(DummyInMemoryCacheLoader.class);
  +   private Map<Object, List<Modification>> transactions = new HashMap<Object, List<Modification>>();
   
      public void setConfig(Properties properties)
      {
  @@ -128,14 +129,29 @@
   
      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
  
  
  



More information about the jboss-cvs-commits mailing list