Package org.jboss.cache

Examples of org.jboss.cache.Modification


      private int txActs = 0;

      @Override
      public Object visitRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand removeNodeCommand) throws Throwable
      {
         Modification mod = new Modification(Modification.ModificationType.REMOVE_NODE, removeNodeCommand.getFqn());
         cacheLoaderModifications.add(mod);
         return null;
      }
View Full Code Here


         return loader.getChildrenNames(fqn) != null;
      }

      private void addRemoveMod(InvocationContext ctx, List<Modification> l, Fqn fqn, Map data)
      {
         Modification mod = new Modification(Modification.ModificationType.REMOVE_NODE, fqn);
         l.add(mod);
         notifier.notifyNodeActivated(fqn, false, data, ctx);
      }
View Full Code Here

      checkNonNull(name, "name");

      Object oldVal;
      if (transactional)
      {
         Modification mod =
               new Modification(Modification.ModificationType.PUT_KEY_VALUE, name, key, value);
         commitModification(mod);
         oldVal = mod.getOldValue();
      }
      else
      {
         oldVal = doPut(null, name, key, value);
      }
View Full Code Here

      checkNonNull(name, "name");

      if (transactional)
      {
         commitModification(
               new Modification(Modification.ModificationType.PUT_DATA, name, values));
      }
      else
      {
         doPut(null, name, values);
      }
View Full Code Here

      checkNonNull(name, "name");

      if (transactional)
      {
         commitModification(
               new Modification(Modification.ModificationType.REMOVE_NODE, name));
      }
      else
      {
         doRemove(null, name);
      }
View Full Code Here

      checkNonNull(name, "name");

      Object oldVal;
      if (transactional)
      {
         Modification mod =
               new Modification(Modification.ModificationType.REMOVE_KEY_VALUE, name, key);
         commitModification(mod);
         oldVal = mod.getOldValue();
      }
      else
      {
         oldVal = doRemove(null, name, key);
      }
View Full Code Here

      checkNonNull(name, "name");

      if (transactional)
      {
         commitModification(
               new Modification(Modification.ModificationType.REMOVE_DATA, name));
      }
      else
      {
         doRemoveData(null, name);
      }
View Full Code Here

      loader.put(list);
      checkModifications(list);

      /* REMOVE_KEY_VALUE */
      list = new ArrayList<Modification>();
      Modification mod = new Modification();
      mod.setType(Modification.ModificationType.REMOVE_KEY_VALUE);
      mod.setFqn(FQN);
      mod.setKey("one");
      list.add(mod);
      loader.put(list);
      checkModifications(list);

      /* REMOVE_NODE */
      list = new ArrayList<Modification>();
      mod = new Modification();
      mod.setType(Modification.ModificationType.REMOVE_NODE);
      mod.setFqn(FQN);
      list.add(mod);
      loader.put(list);
      checkModifications(list);
      assertEquals(null, loader.get(FQN));

      /* REMOVE_DATA */
      loader.put(FQN, "one", "two");
      list = new ArrayList<Modification>();
      mod = new Modification();
      mod.setType(Modification.ModificationType.REMOVE_DATA);
      mod.setFqn(FQN);
      list.add(mod);
      loader.put(list);
      checkModifications(list);
      assertNotNull(loader.get(FQN));
      assertEquals(0, loader.get(FQN).size());
View Full Code Here

   private List<Modification> createUpdates()
   {

      List<Modification> list = new ArrayList<Modification>();

      Modification mod = new Modification();
      mod.setType(Modification.ModificationType.PUT_KEY_VALUE);
      mod.setFqn(FQN);
      mod.setKey("one");
      mod.setValue("two");
      list.add(mod);

      mod = new Modification();
      mod.setType(Modification.ModificationType.PUT_KEY_VALUE);
      mod.setFqn(FQN);
      mod.setKey("three");
      mod.setValue("four");
      list.add(mod);

      /*
      Map<String, String> map = new HashMap<String, String>();
      map.put("five", "six");
View Full Code Here

         throws Exception
   {

      for (int i = 0; i < list.size(); i += 1)
      {
         Modification mod = list.get(i);
         Fqn fqn = mod.getFqn();
         switch (mod.getType())
         {
            case PUT_KEY_VALUE:
               assertEquals(mod.getValue(), loader.get(fqn).get(mod.getKey()));
               break;
            case PUT_DATA:
               Map map = mod.getData();
               for (Object key : map.keySet())
               {
                  assertEquals(map.get(key), loader.get(fqn).get(key));
               }
               break;
            case REMOVE_KEY_VALUE:
               assertEquals(null, loader.get(fqn).get(mod.getKey()));
               break;
            case REMOVE_DATA:
               assertTrue(loader.exists(fqn));
               assertNotNull(loader.get(fqn));
               assertEquals(0, loader.get(fqn).size());
View Full Code Here

TOP

Related Classes of org.jboss.cache.Modification

Copyright © 2018 www.massapicom. 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.