Package org.jboss.cache.optimistic

Examples of org.jboss.cache.optimistic.DefaultDataVersion.increment()


   }

   public void testPropagationOfDefaultVersions() throws Exception
   {
      DefaultDataVersion expected = new DefaultDataVersion();
      expected = (DefaultDataVersion) expected.increment();

      cache[0].put(fqn, key, "value");

      assertEquals("value", cache[0].get(fqn, key));
      assertEquals("value", cache[1].get(fqn, key));
View Full Code Here


      assertEquals("value", cache[1].get(fqn, key));
      assertEquals(expected, cache[0].getNode(fqn).getVersion());
      assertEquals(expected, cache[1].getNode(fqn).getVersion());

      cache[1].put(fqn, key, "value2");
      expected = (DefaultDataVersion) expected.increment();

      assertEquals("value2", cache[0].get(fqn, key));
      assertEquals("value2", cache[1].get(fqn, key));
      assertEquals(expected, cache[0].getNode(fqn).getVersion());
      assertEquals(expected, cache[1].getNode(fqn).getVersion());
View Full Code Here

            DefaultDataVersion v = (DefaultDataVersion) n.getVersion();
            if (trace)
               log.trace("Fqn " + f + " has implicit versioning.  Broadcasting an incremented version.");

            // potential bug here - need to check if we *need* to increment at all, because of Configuration.isLockParentForChildInsertRemove()
            return v.increment();
         }
         else
         {
            if (trace) log.trace("Fqn " + f + " has explicit versioning.  Broadcasting the version as-is.");
            return n.getVersion();
View Full Code Here

   }

   public void testPropagationOfDefaultVersions() throws Exception
   {
      DefaultDataVersion expected = new DefaultDataVersion();
      expected = (DefaultDataVersion) expected.increment();

      cache[0].put(fqn, key, "value");

      assertEquals("value", cache[0].get(fqn, key));
      assertEquals("value", cache[1].get(fqn, key));
View Full Code Here

      assertEquals("value", cache[1].get(fqn, key));
      assertEquals(expected, cache[0].getNode(fqn).getVersion());
      assertEquals(expected, cache[1].getNode(fqn).getVersion());

      cache[1].put(fqn, key, "value2");
      expected = (DefaultDataVersion) expected.increment();

      assertEquals("value2", cache[0].get(fqn, key));
      assertEquals("value2", cache[1].get(fqn, key));
      assertEquals(expected, cache[0].getNode(fqn).getVersion());
      assertEquals(expected, cache[1].getNode(fqn).getVersion());
View Full Code Here

            DefaultDataVersion v = (DefaultDataVersion) n.getVersion();
            if (trace)
               log.trace("Fqn " + f + " has implicit versioning.  Broadcasting an incremented version.");

            // potential bug here - need to check if we *need* to increment at all, because of Configuration.isLockParentForChildInsertRemove()
            return v.increment();
         }
         else
         {
            if (trace) log.trace("Fqn " + f + " has explicit versioning.  Broadcasting the version as-is.");
            return n.getVersion();
View Full Code Here

   }

   public void testPropagationOfDefaultVersions() throws Exception
   {
      DefaultDataVersion expected = new DefaultDataVersion();
      expected = (DefaultDataVersion) expected.increment();

      cache[0].put(fqn, key, "value");

      assertEquals("value", cache[0].get(fqn, key));
      assertEquals("value", cache[1].get(fqn, key));
View Full Code Here

      assertEquals("value", cache[1].get(fqn, key));
      assertEquals(expected, ((OptimisticTreeNode) cache[0].get(fqn)).getVersion());
      assertEquals(expected, ((OptimisticTreeNode) cache[1].get(fqn)).getVersion());

      cache[1].put(fqn, key, "value2");
      expected = (DefaultDataVersion) expected.increment();

      assertEquals("value2", cache[0].get(fqn, key));
      assertEquals("value2", cache[1].get(fqn, key));
      assertEquals(expected, ((OptimisticTreeNode) cache[0].get(fqn)).getVersion());
      assertEquals(expected, ((OptimisticTreeNode) cache[1].get(fqn)).getVersion());
View Full Code Here

      }
      if (n.isVersioningImplicit())
      {
         DefaultDataVersion v = (DefaultDataVersion) n.getVersion();
         if (log.isTraceEnabled()) log.trace("Fqn " + f + " has implicit versioning.  Broadcasting an incremented version.");
         return v.increment();
      }
      else
      {
         if (log.isTraceEnabled()) log.trace("Fqn " + f + " has explicit versioning.  Broadcasting the version as-is.");
         return n.getVersion();
View Full Code Here

         DefaultDataVersion v = (DefaultDataVersion) n.getVersion();
         if (trace)
            log.trace("Fqn " + f + " has implicit versioning.  Broadcasting an incremented version.");

         // potential bug here - need to check if we *need* to increment at all, because of Configuration.isLockParentForChildInsertRemove()
         return v.increment();
      }
      else
      {
         if (trace) log.trace("Fqn " + f + " has explicit versioning.  Broadcasting the version as-is.");
         return n.getVersion();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.