Package org.jboss.cache

Examples of org.jboss.cache.NodeNotExistsException


         // node does not exist; return an empty list since there is nothing to remove!
         return Collections.emptyList();
      } else {
         // update child ref on parent to point to child as this is now a copy.
         if (parentLockNeeded && (needToCopyNode || needToCopyParent)) {
            if (parent == null) throw new NodeNotExistsException("Parent node " + parentFqn + " does not exist!");
            parent.getDelegationTarget().addChild(node.getDelegationTarget());
         }

         // now deal with children.
         Map<Object, InternalNode<?, ?>> childMap = node.getDelegationTarget().getChildrenMap();
View Full Code Here


      // the actual move algorithm.
      // ctx *could* be null if this is a rollback!!!  Sucks big time.
      NodeSPI newParent = ctx == null ? dataContainer.peek(newParentFqn) : ctx.lookUpNode(newParentFqn);
      if (newParent == null || newParent.isDeleted())
      {
         throw new NodeNotExistsException("New parent node " + newParentFqn + " does not exist when attempting to move node!!");
      }

      // ctx *could* be null if this is a rollback!!!  Sucks big time.
      NodeSPI node = ctx == null ? dataContainer.peek(toMoveFqn) : ctx.lookUpNode(toMoveFqn);

      if (node == null || node.isDeleted())
      {
         throw new NodeNotExistsException("Node " + toMoveFqn + " does not exist when attempting to move node!!");
      }

      if (trace) log.trace("Moving " + fqn + " to sit under " + to);

      NodeSPI oldParent = node.getParentDirect();
View Full Code Here

   public Object perform(InvocationContext ctx)
   {
      if (trace) log.trace("Perform('" + globalTransaction + "', '" + fqn + "', k='" + key + "', v='" + value + "')");

      NodeSPI n = ctx.lookUpNode(fqn);
      if (n == null) throw new NodeNotExistsException("Node " + fqn + " does not exist!");


      if (notifier.shouldNotifyOnNodeModified())
      {
         notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, n.getDataDirect(), ctx);
View Full Code Here

      {
         log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", " + data + ")");
      }
//      NodeSPI nodeSPI = dataContainer.peekStrict(globalTransaction, fqn, false);
      NodeSPI nodeSPI = ctx.lookUpNode(fqn);
      if (nodeSPI == null) throw new NodeNotExistsException("Node " + fqn + " does not exist!");
      Map existingData = nodeSPI.getDataDirect();

      if (notifier.shouldNotifyOnNodeModified())
      {
         notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_MAP, existingData == null ? Collections.emptyMap() : existingData, ctx);
View Full Code Here

      {
         // if not, get it from the data container.  No need to wrap here, we're just going to update the parent's child map.
         retval = container.peekInternalNode(parentFqn, false);
      }
      if (retval == null)
         throw new NodeNotExistsException("Node " + parentFqn + " cannot be found in any context or data container!");
      return retval;
   }
View Full Code Here

      else
      {
         // update child ref on parent to point to child as this is now a copy.
         if (parentLockNeeded && (needToCopyNode || needToCopyParent))
         {
            if (parent == null) throw new NodeNotExistsException("Parent node " + parentFqn + " does not exist!");
            parent.getDelegationTarget().addChild(node.getDelegationTarget());
         }

         // now deal with children.
         Map<Object, InternalNode<?, ?>> childMap = node.getDelegationTarget().getChildrenMap();
View Full Code Here

         log.warn("Attempting to move the root node.  Not taking any action, treating this as a no-op.");
         return;
      }

      WorkspaceNode oldParent = fetchWorkspaceNode(ctx, nodeFqn.getParent(), ws, false, true);
      if (oldParent == null) throw new NodeNotExistsException("Node " + nodeFqn.getParent() + " does not exist!");

      if (parentFqn.equals(oldParent.getFqn()))
      {
         log.warn("Attempting to move a node in same place.  Not taking any action, treating this as a no-op.");
         return;
      }
      // retrieve parent
      WorkspaceNode parent = fetchWorkspaceNode(ctx, parentFqn, ws, false, true);
      if (parent == null) throw new NodeNotExistsException("Node " + parentFqn + " does not exist!");

      Object nodeName = nodeFqn.getLastElement();

      // now that we have the parent and target nodes:
      // first correct the pointers at the pruning point
View Full Code Here

   }

   private void putDataMapAndNotify(Map<Object, Object> data, TransactionWorkspace workspace, WorkspaceNode workspaceNode, InvocationContext ctx)
   {
      if (workspaceNode == null)
         throw new NodeNotExistsException("optimisticCreateIfNotExistsInterceptor should have created this node!");
      // pre-notify
      notifier.notifyNodeModified(workspaceNode.getFqn(), true, PUT_MAP, workspaceNode.getData(), ctx);
      workspaceNode.putAll(data);
      workspace.addNode(workspaceNode);
      // post-notify
View Full Code Here

   }

   private Object putDataKeyValueAndNotify(Object key, Object value, TransactionWorkspace workspace, WorkspaceNode workspaceNode, InvocationContext ctx)
   {
      if (workspaceNode == null)
         throw new NodeNotExistsException("optimisticCreateIfNotExistsInterceptor should have created this node!");

      if (notifier.shouldNotifyOnNodeModified())// pre-notify
      {
         notifier.notifyNodeModified(workspaceNode.getFqn(), true, PUT_DATA, workspaceNode.getData(), ctx);
      }
View Full Code Here

      // it is already removed - we can ignore it
      if (workspaceNode == null) return false;

      Fqn parentFqn = workspaceNode.getFqn().getParent();
      WorkspaceNode parentNode = fetchWorkspaceNode(ctx, parentFqn, workspace, false, true);
      if (parentNode == null) throw new NodeNotExistsException("Unable to find parent node with fqn " + parentFqn);

      // pre-notify
      if (notify) notifier.notifyNodeRemoved(workspaceNode.getFqn(), true, workspaceNode.getData(), ctx);

      Fqn nodeFqn = workspaceNode.getFqn();
View Full Code Here

TOP

Related Classes of org.jboss.cache.NodeNotExistsException

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.