Package org.infinispan.tree

Examples of org.infinispan.tree.TreeCacheFactory


      ConfigurationBuilder cb = getDefaultClusteredCacheConfig(CacheMode.INVALIDATION_SYNC, true);
      cb.invocationBatching().enable();
      createClusteredCaches(2, "invalidatedFlagCache", cb);
      cache1 = cache(0, "invalidatedFlagCache");
      cache2 = cache(1, "invalidatedFlagCache");
      TreeCacheFactory tcf = new TreeCacheFactory();
      treeCache1 = tcf.createTreeCache(cache1);
      treeCache2 = tcf.createTreeCache(cache2);
   }
View Full Code Here


   }

   public void testWithFlags() {
      AdvancedCache<String, String> localCache1 = cache1.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL);
      AdvancedCache<String, String> localCache2 = cache2.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL);
      TreeCache<String, String> treeCache1 = new TreeCacheFactory().createTreeCache(localCache1);
      TreeCache<String, String> treeCache2 = new TreeCacheFactory().createTreeCache(localCache2);
      final Fqn fqn = Fqn.fromElements("TEST_WITH_FLAGS");
      treeCache1.put(fqn, KEY, "1");
      treeCache2.put(fqn, KEY, "2");
      assert "2".equals(treeCache2.get(fqn, KEY)) : "treeCache2 was updated locally";
      assert "1".equals(treeCache1.get(fqn, KEY)) : "treeCache1 should not be invalidated in case of LOCAL put in treeCache2";
View Full Code Here

      builder.invocationBatching().enable();
      withCacheManager(new CacheManagerCallable(
            TestCacheManagerFactory.createCacheManager(builder)) {
         @Override
         public void call() {
            TreeCacheFactory tcf = new TreeCacheFactory();
            tcf.createTreeCache(cm.getCache());
         }
      });
   }
View Full Code Here

      ConfigurationBuilder builder = new ConfigurationBuilder();
      withCacheManager(new CacheManagerCallable(
            TestCacheManagerFactory.createCacheManager(builder)) {
         @Override
         public void call() {
            TreeCacheFactory tcf = new TreeCacheFactory();
            tcf.createTreeCache(cm.getCache());
         }
      });
   }
View Full Code Here

      try {
         ConfigurationBuilder cb = new ConfigurationBuilder();
         cb.transaction().transactionManagerLookup(tml)
               .invocationBatching().enable();
         ecm = TestCacheManagerFactory.createCacheManager(cb);
         TreeCache<Object, Object> tc = new TreeCacheFactory().createTreeCache(ecm.<Object, Object>getCache());
         tc.put("/a/b/c", "k", "v");
         assert "v".equals(tc.get("/a/b/c", "k"));
      } finally {
         TestingUtil.killCacheManagers(ecm);
      }
View Full Code Here

      ConfigurationBuilder cb = getDefaultClusteredCacheConfig(CacheMode.INVALIDATION_SYNC, true);
      cb.invocationBatching().enable();
      createClusteredCaches(2, "invalidatedFlagCache", cb);
      cache1 = cache(0, "invalidatedFlagCache");
      cache2 = cache(1, "invalidatedFlagCache");
      TreeCacheFactory tcf = new TreeCacheFactory();
      treeCache1 = tcf.createTreeCache(cache1);
      treeCache2 = tcf.createTreeCache(cache2);
   }
View Full Code Here

   }

   public void testWithFlags() {
      AdvancedCache<String, String> localCache1 = cache1.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL);
      AdvancedCache<String, String> localCache2 = cache2.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL);
      TreeCache<String, String> treeCache1 = new TreeCacheFactory().createTreeCache(localCache1);
      TreeCache<String, String> treeCache2 = new TreeCacheFactory().createTreeCache(localCache2);
      final Fqn fqn = Fqn.fromElements("TEST_WITH_FLAGS");
      treeCache1.put(fqn, KEY, "1");
      treeCache2.put(fqn, KEY, "2");
      assert "2".equals(treeCache2.get(fqn, KEY)) : "treeCache2 was updated locally";
      assert "1".equals(treeCache1.get(fqn, KEY)) : "treeCache1 should not be invalidated in case of LOCAL put in treeCache2";
View Full Code Here

      builder.invocationBatching().enable();
      withCacheManager(new CacheManagerCallable(
            TestCacheManagerFactory.createCacheManager(builder)) {
         @Override
         public void call() {
            TreeCacheFactory tcf = new TreeCacheFactory();
            tcf.createTreeCache(cm.getCache());
         }
      });
   }
View Full Code Here

      ConfigurationBuilder builder = new ConfigurationBuilder();
      withCacheManager(new CacheManagerCallable(
            TestCacheManagerFactory.createCacheManager(builder)) {
         @Override
         public void call() {
            TreeCacheFactory tcf = new TreeCacheFactory();
            tcf.createTreeCache(cm.getCache());
         }
      });
   }
View Full Code Here

      try {
         ConfigurationBuilder cb = new ConfigurationBuilder();
         cb.transaction().transactionManagerLookup(tml)
               .invocationBatching().enable();
         ecm = TestCacheManagerFactory.createCacheManager(cb);
         TreeCache<Object, Object> tc = new TreeCacheFactory().createTreeCache(ecm.<Object, Object>getCache());
         tc.put("/a/b/c", "k", "v");
         assert "v".equals(tc.get("/a/b/c", "k"));
      } finally {
         TestingUtil.killCacheManagers(ecm);
      }
View Full Code Here

TOP

Related Classes of org.infinispan.tree.TreeCacheFactory

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.