Package org.jboss.cache.loader

Examples of org.jboss.cache.loader.NodeData


      Iterator nodes = nodeData.iterator();
      GlobalTransaction gtx = getInvocationContext().getGlobalTransaction();

      while (nodes.hasNext())
      {
         NodeData data = (NodeData) nodes.next();
         if (localOnly)
         {
            if (!cache.exists(data.getFqn()))
            {
               createNodes(gtx, data.getFqn(), data.getAttributes());
            }
         }
         else
         {
            cache.put(data.getFqn(), data.getAttributes());
         }
      }
   }
View Full Code Here


      }
   }

   private List getNodeData(List list, DataNode node)
   {
      NodeData data = new NodeData(BuddyManager.getActualFqn(node.getFqn()), node.getData());
      list.add(data);
      Map children = node.getChildren();
      if (children != null)
      {
         Iterator i = children.keySet().iterator();
View Full Code Here

     
      ByteArrayInputStream in_stream=new ByteArrayInputStream(state, HEADER_LENGTH, transientSize);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
     
      // Read the first NodeData and integrate into our target
      NodeData nd = (NodeData) in.readObject();
      Map attrs = nd.getAttributes();
      if (attrs != null)
         target.put(attrs, true);
      else
         target.clear();
     
      // Check whether this is an integration into the buddy backup subtree
      Fqn tferFqn = nd.getFqn();
      Fqn tgtFqn = target.getFqn();     
      boolean move = tgtFqn.isChildOrEquals(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN)
                     && !tferFqn.isChildOrEquals(tgtFqn);
      // If it is an integration, calculate how many levels of offset
      int offset = move ? tgtFqn.size() - tferFqn.size() : 0;
View Full Code Here

      Fqn fqn;
      int size;
      Object name;
      try
      {
         NodeData nd = (NodeData) in.readObject();
         while (nd != null) {           
            fqn = nd.getFqn();
            // If we need to integrate into the buddy backup subtree,
            // change the Fqn to fit under it
            if (offset > 0)
               fqn = new Fqn(parent.getFqn().getFqnChild(offset), fqn);
            size = fqn.size();
            if (size <= parent_level)
               return nd;
            else if (size > target_level)
               throw new IllegalStateException("NodeData " + fqn +
                                               " is not a direct child of " +
                                               parent.getFqn());

            name = fqn.get(size - 1);
           
            Map attrs = nd.getAttributes();
           
            // We handle this NodeData.  Create a DataNode and
            // integrate its data           
            DataNode target = factory.createDataNode(nodeType,
                                                     name,
View Full Code Here

     
      ByteArrayInputStream in_stream=new ByteArrayInputStream(state, HEADER_LENGTH, transientSize);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
     
      // Read the first NodeData and integrate into our target
      NodeData nd = (NodeData) in.readObject();
      Map attrs = nd.getAttributes();
      if (attrs != null)
         target.put(attrs, true);
      else
         target.clear();
     
View Full Code Here

      Fqn fqn;
      int size;
      Object name;
      try
      {
         NodeData nd = (NodeData) in.readObject();
         while (nd != null) {           
            fqn = nd.getFqn();
            size = fqn.size();
            if (size <= parent_level)
               return nd;
            else if (size > target_level)
               throw new IllegalStateException("NodeData " + fqn +
                                               " is not a direct child of " +
                                               parent.getFqn());

            name = fqn.get(size - 1);
           
            Map attrs = nd.getAttributes();
           
            // We handle this NodeData.  Create a DataNode and
            // integrate its data           
            DataNode target = factory.createDataNode(nodeType,
                                                     name,
View Full Code Here

    */
   private void marshallTransientState(DataNode node,
                                       ObjectOutputStream out) throws Exception
   {     
      Map       attrs;
      NodeData  nd;

      // first handle the current node
      attrs=node.getData();
      if(attrs == null || attrs.size() == 0)
         nd=new NodeData(node.getFqn());
      else
         nd=new NodeData(node.getFqn(), attrs);
      out.writeObject(nd);

      // then visit the children
      Map children = node.getChildren();
      if(children == null)
View Full Code Here

     
      ByteArrayInputStream in_stream=new ByteArrayInputStream(transient_state);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
     
      // Read the first NodeData and integrate into our target
      NodeData nd = (NodeData) in.readObject();
      Map attrs = nd.getAttributes();
      if (attrs != null)
         target.put(attrs, true);
      else
         target.clear();
     
View Full Code Here

      Fqn fqn;
      int size;
      Object name;
      try
      {
         NodeData nd = (NodeData) in.readObject();
         while (nd != null) {           
            fqn = nd.getFqn();
            size = fqn.size();
            if (size <= parent_level)
               return nd;
            else if (size > target_level)
               throw new IllegalStateException("NodeData " + fqn +
                                               " is not a direct child of " +
                                               parent.getFqn());

            name = fqn.get(size - 1);
           
            Map attrs = nd.getAttributes();
           
            // We handle this NodeData.  Create a DataNode and
            // integrate its data           
            DataNode target = factory.createDataNode(nodeType,
                                                     name,
View Full Code Here

  
      if (internalFqns.contains(node.getFqn()))
         return;
     
      Map       attrs;
      NodeData  nd;

      // first handle the current node
      attrs=node.getData();
      if(attrs == null || attrs.size() == 0)
         nd=new NodeData(node.getFqn());
      else
         nd=new NodeData(node.getFqn(), attrs);
      out.writeObject(nd);

      // then visit the children
      Map children = node.getChildren();
      if(children == null)
View Full Code Here

TOP

Related Classes of org.jboss.cache.loader.NodeData

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.