Examples of Fqn


Examples of org.jboss.cache.Fqn

   {
      List<CacheSPI<Object, Object>> caches = createCachesWithSharedCL(true);
      cache1 = caches.get(0);
      cache2 = caches.get(1);

      Fqn fqn = Fqn.fromString("/a/b");
      TransactionManager mgr = caches.get(0).getTransactionManager();
      assertNull("Should be null", caches.get(0).get(fqn, "key"));
      assertNull("Should be null", caches.get(1).get(fqn, "key"));
      mgr.begin();
      caches.get(0).put(fqn, "key", "value");

Examples of org.jboss.cache.Fqn

      caches.get(0).start();
      caches.get(1).start();

      TestingUtil.blockUntilViewsReceived(caches.toArray(new CacheSPI[0]), 5000);

      Fqn fqn = Fqn.fromString("/a/b");

      assertNull("Should be null", caches.get(0).getNode(fqn));
      assertNull("Should be null", caches.get(1).getNode(fqn));

      caches.get(0).put(fqn, "key", "value");

Examples of org.jboss.cache.Fqn

   protected void doMapTest(int size) throws Exception
   {
      CacheMarshallerTestBaseTL tl = threadLocal.get();
      VersionAwareMarshaller marshaller = tl.marshaller;
      Map map = createMap(size);
      Fqn fqn = Fqn.fromString("/my/stuff");
      String key = "key";
      PutKeyValueCommand putCommand = new PutKeyValueCommand(null, fqn, key, map);
      ReplicateCommand replicateCommand = new ReplicateCommand(putCommand);

      byte[] buf = marshaller.objectToByteBuffer(replicateCommand);

Examples of org.jboss.cache.Fqn

      cache1.start();
      cache2.start();

      TestingUtil.blockUntilViewsReceived(new Cache[]{cache1, cache2}, 10000);

      Fqn fqn = Fqn.fromString("/a");
      cache1.put(fqn, "key", "value");
      assertEquals("Value replicated", "value", cache2.get(fqn, "key"));
   }

Examples of org.jboss.cache.Fqn

      MarshalledValueOutputStream os = new MarshalledValueOutputStream(baos);
      loader.loadEntireState(os);
      os.close();

      /* Add three FQNs, middle FQN last. */
      Fqn k1 = Fqn.fromString("/key1");
      Fqn k2 = Fqn.fromString("/key2");
      Fqn k3 = Fqn.fromString("/key3");

      doPutTests(k1);
      doPutTests(k3);
      doPutTests(k2);
      assertEquals(4, loader.get(k1).size());

Examples of org.jboss.cache.Fqn

   {

      startLoader(false, null);

      /* Create top level node implicitly. */
      Fqn k0 = Fqn.fromString("/key0");
      Fqn k1 = Fqn.fromString("/key1");
      Fqn k2 = Fqn.fromString("/key2");
      Fqn k3 = Fqn.fromString("/key3");

      assertTrue(!loader.exists(k0));
      loader.put(Fqn.fromString("/key0/level1/level2"), null);
      assertTrue(loader.exists(Fqn.fromString("/key0/level1/level2")));
      assertTrue(loader.exists(Fqn.fromString("/key0/level1")));

Examples of org.jboss.cache.Fqn

   {

      for (int i = 0; i < list.size(); i += 1)
      {
         Modification mod = list.get(i);
         Fqn fqn = mod.getFqn();
         switch (mod.getType())
         {
            case PUT_KEY_VALUE:
               assertEquals(mod.getValue(), loader.get(fqn).get(mod.getKey()));
               break;

Examples of org.jboss.cache.Fqn

      cache.getTransactionManager().commit();
   }

   public void testLazyLoadingOnCacheMove() throws Exception
   {
      Fqn newparentToMoveTo = Fqn.fromString("/newparent");
      Fqn newparent = Fqn.fromString("/newparent/parent");
      Fqn newchild = Fqn.fromString("/newparent/parent/child");
      cache.getTransactionManager().begin();
      cache.move(parent, newparentToMoveTo);
      assert !cache.getRoot().hasChild(parent) : "Node should be removed";
      assert !cache.getRoot().hasChild(child) : "Node should be removed";
      assert cache.getRoot().hasChild(newparent) : "Node should have moved";

Examples of org.jboss.cache.Fqn

      cache.getTransactionManager().commit();
   }

   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);

Examples of org.jboss.cache.Fqn

      sharedCl.remove(Fqn.ROOT);
   }

   public void testPessimisticNonTransactionalWithCacheLoader() throws Exception
   {
      Fqn fqn = Fqn.fromString("/a/b");
      cache1.put(fqn, "key", "value");

      assertEquals("value", cache1.get(fqn, "key"));
      assertEquals("value", cache2.get(fqn, "key"));
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.