Package org.jboss.cache

Examples of org.jboss.cache.NodeSPI


      return oldValue;
   }

   public void rollback()
   {
      NodeSPI n = dataContainer.peek(fqn, false, false);
      if (n == null) throw new CacheException("node " + fqn + " not found for rollback!");
      if (oldValue == null)
      {
         n.removeDirect(key);
      }
      else
      {
         n.putDirect(key, oldValue);
      }
   }
View Full Code Here


   @Override
   public Object perform(InvocationContext ctx)
   {
      if (globalTransaction != null)
      {
         NodeSPI n = ctx.lookUpNode(fqn);
         originalData = n == null ? null : new HashMap(n.getDataDirect());
      }
      return super.perform(ctx);
   }
View Full Code Here

   public void rollback()
   {
      if (trace) log.trace("rollback(" + globalTransaction + ", \"" + fqn + "\", " + originalData + ")");
      if (originalData != null && !originalData.isEmpty())
      {
         NodeSPI nodeSpi = dataContainer.peek(fqn, false, true);
         if (nodeSpi == null)
         {
            if (trace)
               log.trace("Not rolling back node clearance for node: " + fqn + " as it does not exist in the cache. " +
                     "This might be the result of an NoOp clear operation");
            return;
         }
         nodeSpi.putAllDirect(originalData);
      }
   }
View Full Code Here

   @Override
   public Object perform(InvocationContext ctx)
   {
      // first get a hold of existing data.
      NodeSPI node = ctx.lookUpNode(fqn);
      Map existingData = node == null ? null : node.getDataDirect();
      if (existingData != null && !existingData.isEmpty())
      {
         oldData = new HashMap(existingData); // defensive copy
      }
      return super.perform(ctx);
View Full Code Here

   }

   public void rollback()
   {
      if (trace) log.trace("rollback(" + globalTransaction + ", " + fqn + ", " + data + ")");
      NodeSPI n = dataContainer.peek(fqn, false, true);
      if (n != null)
      {
         n.clearDataDirect();
         if (oldData != null) n.putAllDirect(oldData);
      }
   }
View Full Code Here

    */
   public Object perform(InvocationContext ctx)
   {
      if (trace) log.trace("perform(" + globalTransaction + ", \"" + fqn + "\")");

      NodeSPI targetNode = peekVersioned(ctx);
      if (targetNode == null)
      {
         log.warn("node " + fqn + " not found");
         return null;
      }

      Map data = targetNode.getDataDirect();
      notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.REMOVE_DATA, data, ctx);
      targetNode.clearDataDirect();
      notifier.notifyNodeModified(fqn, false, NodeModifiedEvent.ModificationType.REMOVE_DATA, data, ctx);
      return null;
   }
View Full Code Here

      return oldValue;
   }

   public void rollback()
   {
      NodeSPI n = dataContainer.peek(fqn, false, false);
      if (n == null) throw new CacheException("node " + fqn + " not found for rollback!");
      if (oldValue == null)
      {
         n.removeDirect(key);
      }
      else
      {
         n.putDirect(key, oldValue);
      }
   }
View Full Code Here

   public void rollback()
   {
      if (oldValue != null)
      {
         NodeSPI targetNode = dataContainer.peek(fqn, false, true);
         if (targetNode != null) targetNode.putDirect(key, oldValue);
      }
   }
View Full Code Here

    */
   public Object perform(InvocationContext ctx)
   {
      if (trace) log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", key=" + key + ")");

      NodeSPI n = ctx.lookUpNode(fqn);
      if (n == null)
      {
         if (log.isDebugEnabled()) log.debug("node " + fqn + " not found");
         return null;
      }
      if (notifier.shouldNotifyOnNodeModified())
      {
         notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.REMOVE_DATA, n.getDataDirect(), ctx);
      }
      Object oldValue = n.removeDirect(key);
      if (notifier.shouldNotifyOnNodeModified())
      {
         Map removedData = Collections.singletonMap(key, oldValue);
         notifier.notifyNodeModified(fqn, false, NodeModifiedEvent.ModificationType.REMOVE_DATA, removedData, ctx);
      }
View Full Code Here

    * @param ctx invocation context
    * @return null
    */
   public Object perform(InvocationContext ctx)
   {
      NodeSPI node = enforceNodeLoading();
      if (trace) log.trace("Invalidating fqn:" + fqn);
      if (node == null)
      {
         return null;
      }
View Full Code Here

TOP

Related Classes of org.jboss.cache.NodeSPI

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.