Package org.jboss.cache

Examples of org.jboss.cache.TreeCache


   }

   public void setUp() throws Exception
   {
      super.setUp();
      cache_ = new TreeCache();
      cache_.setUseMarshalling(true);
      initCaches(cache_);
//      cache1_ = new TreeCache();
//      initCaches(cache1_);
      cache_.startService();
//      cache1_.startService();
      // cache2 doesn't have eviction policy
      cache2_ = new TreeCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(cache2_, "META-INF/replSync-service.xml"); // read in generic local xml
      cache2_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache2_.startService();
View Full Code Here


   }

   public void setUp() throws Exception
   {
      super.setUp();
      cache_ = new TreeCache();
      initCaches(cache_);
//      cache1_ = new TreeCache();
//      initCaches(cache1_);
      cache_.setUseMarshalling(true);
      cache_.addTreeCacheListener((TreeCacheListener)listener_);
      listener_.resetCounter();

      cache_.startService();
//      cache1_.startService();
      // cache2 doesn't have eviction policy
      cache2_ = new TreeCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(cache2_, "META-INF/replSync-service.xml"); // read in generic local xml
      cache2_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache2_.setUseMarshalling(true);
      cache2_.startService();
View Full Code Here

         p=new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
      }

      tx=(UserTransaction)new InitialContext(p).lookup("UserTransaction");
      cache=new TreeCache("test", null, 10000);
      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache.setIsolationLevel(IsolationLevel.SERIALIZABLE);

      cache.setLockParentForChildInsertRemove(true); // these tests are written with this assumption in mind
      cache.createService();
View Full Code Here

    protected boolean useRegionBasedMarshalling = false;

    protected void setUp() throws Exception
    {
        if (cache1 != null || cache2 != null) tearDown();
        cache1 = new TreeCache("CCL-Test", null, 2000);
        cache2 = new TreeCache("CCL-Test", null, 2000);

        cache1.setCacheMode(TreeCache.REPL_SYNC);
        cache2.setCacheMode(TreeCache.REPL_SYNC);

        cache1.setCacheLoaderConfiguration( getSingleCacheLoaderConfig("", "org.jboss.cache.loader.ClusteredCacheLoader", "timeout=500", false, false, false) );
View Full Code Here

      log("creating cache2");
      cache2=createCache("CacheGroup");
   }

   private TreeCache createCache(String name) throws Exception {
      TreeCache tree=new TreeCache();
      PropertyConfigurator config=new PropertyConfigurator();
      config.configure(tree, "META-INF/replAsync-service.xml"); // read in generic replAsync xml
      tree.setClusterName(name);
     
      // Call the hook that allows mux integration
      configureMultiplexer(tree);
     
      tree.createService();
      tree.startService();
     
      validateMultiplexer(tree);
     
      return tree;
   }
View Full Code Here

       }

   }

   public void testPutShouldNotReplicateToDifferentCluster() {
      TreeCache cache3=null;
      try {
         cache3=createCache("DifferentGroup");
         cache1.put("/a/b/c", "age", new Integer(38));
         // because we use async repl, modfication may not yet have been propagated to cache2, so
         // we have to wait a little
          TestingUtil.sleepThread((long)1000);
          assertNull("Should not have replicated", cache3.get("/a/b/c", "age"));
      }
      catch(Exception e) {
         fail(e.toString());
      }
      finally {
         if(cache3 != null)
            cache3.stopService();
      }
   }
View Full Code Here

            cache3.stopService();
      }
   }

   public void testStateTransfer() {
      TreeCache cache4=null;
      try {
         cache1.put("a/b/c", "age", new Integer(38));
         cache4=createCache("CacheGroup");
          System.out.println("" + cache4.getMembers());
         assertEquals(3, cache4.getMembers().size()); // cache1, cache2 and cache4
         assertEquals("\"age\" should be 38", new Integer(38), cache4.get("/a/b/c", "age"));
      }
      catch(Exception e) {
         fail(e.toString());
      }
      finally {
         if(cache4 != null) {
            System.out.println("cache4's view: " + cache4.getMembers());
            cache4.stopService();
         }
      }
   }
View Full Code Here

        if (!dir2.exists()) dir2.mkdirs();
    }

    protected void startCache(boolean ignoreMods1, boolean ignoreMods2) throws Exception
    {
        cache = new TreeCache();
        cache.setCacheLoaderConfiguration(getCacheLoaderConfig(loc1, loc2, ignoreMods1, ignoreMods2));
        cache.setCacheMode("local");
        cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
        cache.startService();
View Full Code Here

   TreeCache cache;
   TransactionManager mgr;

   protected void setUp() throws Exception {
      super.setUp();
      cache=new TreeCache();
      cache.setCacheMode("local");
      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      cache.createService();
      cache.startService();
      mgr = cache.getTransactionManager();
View Full Code Here

      readerFailed = false;

      writerError = null;
      readerError = null;
     
      cache = new TreeCache();
      cache.setCacheMode(TreeCache.LOCAL);
      cache.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache.setLockAcquisitionTimeout(1000);
      cache.startService();
View Full Code Here

TOP

Related Classes of org.jboss.cache.TreeCache

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.