Package org.jboss.cache

Examples of org.jboss.cache.Node


                  }

                  @SuppressWarnings("unchecked")
                  public Entry<K, V> next()
                  {
                     Node n = i.next();
                     this.name = n.getFqn().getLastElement();
                     this.next = true;
                     Object key = n.get(KEY);
                     return new SimpleImmutableEntry(name, key);
                  }

                  public void remove()
                  {
View Full Code Here


      @Override
      @SuppressWarnings("unchecked")
      public V get(Object arg0)
      {
         Node child = node.getChild(arg0);
         if (child == null)
            return null;
         return (V) child.get(KEY);
      }
View Full Code Here

      @Override
      @SuppressWarnings("unchecked")
      public V remove(Object arg0)
      {
         Node child = node.getChild(arg0);
         if (child == null)
            return null;
         V o = (V) child.remove(KEY);
         node.removeChild(arg0);
         return o;
      }
View Full Code Here

      public int size()
      {
         int size = 0;
         for (Object o : node.getChildrenNames())
         {
            Node child = node.getChild(o);
            size += child.dataSize();
         }
         return size;
      }
View Full Code Here

   }

   public void testLazyLoadingOnNodeGet() throws Exception
   {
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      assert node.getData().size() == 1 : "Node should have data";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert !n.isChildrenLoaded() : "Should not have loaded children";
      cache.getTransactionManager().commit();
   }
View Full Code Here

   }

   public void testLazyLoadingOnNodeRemove() throws Exception
   {
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      node.clearData();
      assert node.getData().size() == 0 : "Node should have removed data";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert !n.isChildrenLoaded() : "Should not have loaded children";
      cache.getTransactionManager().commit();
   }
View Full Code Here

   }

   public void testLazyLoadingOnNodePut() throws Exception
   {
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      node.put("k2", "v2");
      assert node.getData().size() == 2 : "Node should have added data";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert !n.isChildrenLoaded() : "Should not have loaded children";
      cache.getTransactionManager().commit();
   }
View Full Code Here

   }

   public void testLazyLoadingOnNodeGetChildrenNames() throws Exception
   {
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      assert node.getChildrenNames().size() == 1 : "Node should have 1 child";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert n.isChildrenLoaded() : "Should have loaded children";
      cache.getTransactionManager().commit();
   }
View Full Code Here

   }

   public void testLazyLoadingOnNodeGetChildren() throws Exception
   {
      cache.getTransactionManager().begin();
      Node node = cache.getRoot().getChild(parent);
      assert node.getChildren().size() == 1 : "Node should have 1 child";
      WorkspaceNode n = getWorkspaceNode(parent);
      assert n.isChildrenLoaded() : "Should 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

TOP

Related Classes of org.jboss.cache.Node

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.