Package org.jboss.cache

Examples of org.jboss.cache.Modification


            m_txActivations.put(gtx, new Integer(txActs));
      }
   }

   private void addRemoveMod(List l, Fqn fqn) {
       Modification mod = new Modification(Modification.REMOVE_NODE, fqn);
       l.add(mod);
       cache.notifyNodeActivate(fqn, false);
   }
View Full Code Here


   public void put(List modifications) throws Exception
   {
      if (modifications == null) return;
      for (Iterator it = modifications.iterator(); it.hasNext();)
      {
         Modification m = (Modification) it.next();
         switch (m.getType())
         {
            case Modification.PUT_DATA:
               put(m.getFqn(), m.getData());
               break;
            case Modification.PUT_DATA_ERASE:
               put(m.getFqn(), m.getData(), true);
               break;
            case Modification.PUT_KEY_VALUE:
               put(m.getFqn(), m.getKey(), m.getValue());
               break;
            case Modification.REMOVE_DATA:
               removeData(m.getFqn());
               break;
            case Modification.REMOVE_KEY_VALUE:
               remove(m.getFqn(), m.getKey());
               break;
            case Modification.REMOVE_NODE:
               remove(m.getFqn());
               break;
            default:
               log.error("modification type " + m.getType() + " not known");
               break;
         }
      }
   }
View Full Code Here

   }

   // todo: we should probably implement put(List) in TreeCache itself, so we don't need to invoke each mod separately
   protected void delegatePut(List modifications) throws Exception {
      for(Iterator it=modifications.iterator(); it.hasNext();) {
         Modification m=(Modification)it.next();
         switch(m.getType()) {
            case Modification.PUT_DATA:
               put(m.getFqn(), m.getData());
               break;
            case Modification.PUT_DATA_ERASE:
               put(m.getFqn(), m.getData(), true);
               break;
            case Modification.PUT_KEY_VALUE:
               put(m.getFqn(), m.getKey(), m.getValue());
               break;
            case Modification.REMOVE_DATA:
               removeData(m.getFqn());
               break;
            case Modification.REMOVE_KEY_VALUE:
               remove(m.getFqn(), m.getKey());
               break;
            case Modification.REMOVE_NODE:
               remove(m.getFqn());
               break;
            default:
               log.error("modification type " + m.getType() + " not known");
               break;
         }
      }
   }
View Full Code Here

         out.writeInt(length);
         if (length > 0)
         {
            for (Iterator it = modifications.iterator(); it.hasNext();)
            {
               Modification m = (Modification) it.next();
               m.writeExternal(out);
            }
         }
         out.flush();
         Object retval = in.readObject();
         if (retval instanceof Exception)
View Full Code Here

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

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

   }

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

      return oldValue;
   }

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

      enqueue(mod);
   }

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

      return delegateTo.loadEntireState();
   }

   void storeState(byte[] state, Fqn subtree) throws Exception
   {
      Modification mod = new Modification(Modification.STORE_STATE, subtree, null, state);
      enqueue(mod);
   }
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.