Package org.jboss.cache

Examples of org.jboss.cache.Node


      final Fqn NODE = Fqn.fromString("/test");
      final String KEY = "key";
      cache.put(NODE, KEY, 10);
      cache.evict(NODE, false);
      addDelay();
      Node ret = cache.getNode(NODE);
      assertNotNull(ret);
   }
View Full Code Here


      {
         cache.put("/a/1", null);
         cache.put("/a/2", null);
         cache.put("/a/3", null);

         Node n = cache.getNode("/a");
         assertNotNull(n);

         Set children = n.getChildrenNames();
         assertNotNull(children);
         assertEquals(3, children.size());
      }
      catch (Exception e)
      {
View Full Code Here

      Map<Object, Object> map = new HashMap<Object, Object>();
      map.put("keyA", "valA");
      map.put("keyB", "valB");
      map.put("keyC", "valC");
      assertEquals(map, loader.get(key));
      Node n = cache.getRoot().getChild(key);
      n.clearData();
      assertEquals(Collections.emptyMap(), loader.get(key));
   }
View Full Code Here

         public void run()
         {
            if (e.isPre() && selected_node != null && selected_node.getFqn().equals(e.getFqn()))//&& !isLocal)
            {
               clearTable();
               Node n = root.getChild(e.getFqn());
               if (n != null)
               {
                  populateTable(n.getData());
               }
            }
         }
      };
      executor.execute(r);
View Full Code Here

         m.put("name", "Bela");
         m.put("id", 322649);
         cache.put("/bela/ban", m);
         tx.rollback();

         Node n = cache.getNode("/bela/ban");
         if (n.getData() == null)
            return;
         assertEquals("map should be empty", 0, n.getData().size());
      }
      catch (Throwable t)
      {
         t.printStackTrace();
         fail(t.toString());
View Full Code Here

      System.out.println(cache);

      for (int i = 0; i < 10; i++)
      {
         String f = "/org/jboss/test/data/" + i;
         Node node = cache.getNode(f);
         System.out.println("Node for " + f + " is " + node);
         if (i % 2 == 0)
         {
            if (i < 6)
            {
View Full Code Here

      for (int i = 0; i < 20; i++)
      {
         String str = rootStr + Integer.toString(i);
         Fqn fqn = Fqn.fromString(str);
         Node node = cache.getNode(fqn);
         System.out.println(i + " " + node);
         if (i > 9)
         {
            assertNull("Testing at " + i, node);
         }
         else
         {
            assertEquals(1 + i, node.getData().size());
         }
      }

      for (int i = 0; i < 17; i++)
      {
         cache.put("/org/jboss/data/3", 100 + i, "value");
      }

      Node node = cache.getNode("/org/jboss/data/3");
      assertEquals(21, node.getData().size());

      assert waitForEviction(cache, 30, TimeUnit.SECONDS, Fqn.fromString("/org/jboss/data/3")) : "Eviction event not received!";
      TestingUtil.sleepThread(200); // small grace period

      assertNull(cache.getNode("/org/jboss/data/3"));
View Full Code Here

      retrieverThread.setDaemon(true);
      retrieverThread.start();
      assert waitForEviction(cache, 30, TimeUnit.SECONDS, Fqn.fromString(rootStr + 3));
      String val = (String) cache.get(rootStr + "3", rootStr + "3");
      assertNull("Node should be empty ", val);
      Node n = cache.getNode(fqn7);
      assert n != null;
      val = (String) n.get(rootStr + "7");
      assertNotNull("Node should not be empty ", val);
      retrieverThread.interrupt();
      retrieverThread.join();
      new EvictionController(cache).startEviction(true);
      assert waitForEviction(cache, 30, TimeUnit.SECONDS, Fqn.fromString(rootStr + 7));
View Full Code Here

      assertNull("Node should be empty ", val);
   }

   public void testOvereviction() throws Exception
   {
      Node node = cache.getRoot().addChild(Fqn.fromString("/base/"));
      node.setResident(true);
      cache.getRoot().setResident(true);

      EvictionWatcher ew = new EvictionWatcher(cache, Fqn.fromString("/base/1"));

      for (int i = 1; i < baseRegionMaxNodes + 2; i++)
View Full Code Here

   public void testRemovalWithSpecifiedVersion() throws Exception
   {
      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

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.