Package org.jboss.cache

Examples of org.jboss.cache.Modification


   public Object put(Fqn name, Object key, Object value) throws Exception
   {
      if (config.getUseAsyncPut())
      {
         Object oldValue = get(name, key);
         Modification mod = new Modification(Modification.ModificationType.PUT_KEY_VALUE, name, key, value);
         enqueue(mod);
         return oldValue;
      }
      else
      {
View Full Code Here


   {
      if (config.getUseAsyncPut())
      {
         // JBCACHE-769 -- make a defensive copy
         Map attrs = (attributes == null ? null : Immutables.immutableMapCopy(attributes));
         Modification mod = new Modification(Modification.ModificationType.PUT_DATA, name, attrs);
         enqueue(mod);
      }
      else
      {
         super.put(name, attributes); // Let delegate make its own defensive copy
View Full Code Here

   @Override
   public Object remove(Fqn name, Object key) throws Exception
   {
      Object oldValue = get(name, key);
      Modification mod = new Modification(Modification.ModificationType.REMOVE_KEY_VALUE, name, key);
      enqueue(mod);
      return oldValue;
   }
View Full Code Here

   }

   @Override
   public void remove(Fqn name) throws Exception
   {
      Modification mod = new Modification(Modification.ModificationType.REMOVE_NODE, name);
      enqueue(mod);
   }
View Full Code Here

   }

   @Override
   public void removeData(Fqn name) throws Exception
   {
      Modification mod = new Modification(Modification.ModificationType.REMOVE_DATA, name);
      enqueue(mod);
   }
View Full Code Here

      {
         log.trace("Checking for modifications");
         int i = queue.drainTo(mods, config.getBatchSize());
         if (i == 0)
         {
            Modification m = queue.take();
            mods.add(m);
         }

         if (trace)
         {
View Full Code Here

      CacheLoader loader = cache.getCacheLoaderManager().getCacheLoader();
      Fqn fqn = Fqn.fromString("/a/b/c/d");
      HashMap<Object, Object> map = new HashMap<Object, Object>();
      map.put("c", "d");
      // Three kinds of puts!
      Modification mod = new Modification(Modification.ModificationType.PUT_KEY_VALUE, fqn, "e", "f");
      loader.put(fqn, map);
      loader.put(fqn, "a", "b");
      loader.put(Collections.singletonList(mod));
      System.out.println(loader.get(fqn));
      assertEquals("put right away", 3, loader.get(fqn).size());
View Full Code Here

      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

                  case TcpCacheOperations.PUT_LIST:
                     int length = input.readInt();
                     retval = Boolean.TRUE;
                     if (length > 0)
                     {
                        Modification mod;
                        List<Modification> mods = new ArrayList<Modification>(length);
                        for (int i = 0; i < length; i++)
                        {
                           mod = new Modification();
                           mod.readExternal(input);
                           mods.add(mod);
                        }
                        try
                        {
                           handleModifications(mods);
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.