Package org.jboss.cache

Examples of org.jboss.cache.Node.addChild()


   public void testLazyLoadingOnNodeAddChild() throws Exception
   {
      Fqn newChild = Fqn.fromString("/newchild");
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      node.addChild(newChild);
      assert node.hasChild(newChild) : "Node should have added child";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert !n.isChildrenLoaded() : "Should not have loaded children";
      cache.getTransactionManager().commit();
   }
View Full Code Here


   public void testLazyLoadingOnNodeAddChild() throws Exception
   {
      Fqn newChild = Fqn.fromString("/newchild");
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      node.addChild(newChild);
      assert node.hasChild(newChild) : "Node should have added child";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert !n.isChildrenLoaded() : "Should not have loaded children";
      cache.getTransactionManager().commit();
   }
View Full Code Here

   {
      Fqn fqn = Fqn.fromString("/test/node");

      Node root = cache1.getRoot();
      cache1.getInvocationContext().getOptionOverrides().setDataVersion(new NonLockingDataVersion());
      root.addChild(fqn);
      cache1.getInvocationContext().getOptionOverrides().setDataVersion(new NonLockingDataVersion());
      cache1.removeNode(fqn);

      Assert.assertNull(cache1.getRoot().getChild(fqn));
   }
View Full Code Here

      CacheSPI<Object, Object> cache = cacheTL.get();
      Node<Object, Object>  rootNode = cache.getRoot();

      // creates a Node<Object, Object> with fqn /a/b/c
      Node childA = rootNode.addChild(A);
      childA.addChild(B).addChild(C);

      rootNode.getChild(A).put("key", "value");
      rootNode.getChild(A).getChild(B).put("key", "value");
      rootNode.getChild(A).getChild(B).getChild(C).put("key", "value");
View Full Code Here

  }
 
  private void getNode() {
    Cache cache = createCacheUseDefault();
    Node root = cache.getRoot();
    root.addChild(Fqn.fromString("/a/b/c"));
    Node b = root.getChild(Fqn.fromString("/a/b"));
   
    b.put("k1", "v1");
    b.put("k2", "v2");
    b.put("k3", "v3");
View Full Code Here

                        " and activate the webapp's Region");
            Node root = plainCache_.getRoot();
            if (root.hasChild(pathFqn) == false)
            {
               plainCache_.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
               root.addChild(pathFqn);
            }
            Region region = plainCache_.getRegion(pathFqn, true);
            region.registerContextClassLoader(webAppClassLoader_);
            region.activate();
         }
View Full Code Here

   {
      Fqn fqn = Fqn.fromString("/test/node");

      Node root = cache1.getRoot();
      cache1.getInvocationContext().getOptionOverrides().setDataVersion(new NonLockingDataVersion());
      root.addChild(fqn);
      cache1.getInvocationContext().getOptionOverrides().setDataVersion(new NonLockingDataVersion());
      cache1.removeNode(fqn);

      Assert.assertNull(cache1.getRoot().getChild(fqn));
   }
View Full Code Here

                        " and activate the webapp's Region");
            Node root = plainCache_.getRoot();
            if (root.hasChild(pathFqn) == false)
            {
               plainCache_.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
               root.addChild(pathFqn);
            }
            Region region = plainCache_.getRegion(pathFqn, true);
            region.registerContextClassLoader(webAppClassLoader_);
            region.activate();
         }
View Full Code Here

      if (base == null)
      {
         log.debug("The node retrieved is null from fqn: " + f);
         return;
      }
      base.addChild(child);
   }

   /**
    * Note that caller of this method will take care of synchronization within the <code>fqn</code> sub-tree.
    *
 
View Full Code Here

         Integer lastChild = (Integer) childrenNames.last();
         childName = lastChild + 1;
      }

      cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
      defunctRootNode.addChild(Fqn.fromElements(childName));
      return Fqn.fromRelativeElements(defunctRoot, childName);
   }


   /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.