Package org.jboss.cache

Examples of org.jboss.cache.TreeCache


      /*
       * Create a dummy TreeCache object.  This is used for setting the cluster
       * name and TransactionManagerLookupClass (transactional) propertes only.
       * the TreeCache object is not used otherwise during testing.
       */
      treeCache = new TreeCache();
      treeCache.setClusterName("myCluster");
      if (transactional) {
         treeCache.setTransactionManagerLookupClass(
            "org.jboss.cache.DummyTransactionManagerLookup");
      }
View Full Code Here


    * Check exception cases that occur before create().
    */
   private void checkPreCreateExceptions()
      throws Exception {

      loader.setCache(new TreeCache());
      loader.setConfig(null);
      try {
         loader.start();
         // fail();
      } catch (IllegalStateException expected) {}

      // loader.setCache(null);
      Properties props=new Properties();
      props.setProperty("location", "xyz");
      loader.setConfig(props);
      try {
         loader.start();
         fail();
      } catch (IllegalStateException expected) {}

      loader.setCache(new TreeCache());
      props=new Properties();
      props.setProperty("location", "directory_that_does_not_exist");
      loader.setConfig(props);
      try {
         loader.start();
View Full Code Here

         assertNull(JNDI_NAME + " not bound", obj);
      }
      catch (NameNotFoundException n) {
         // expected
      }
      cache=new TreeCache();
      cache.setCacheMode("local");
      cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
       cache.setCacheLoaderConfiguration(getCacheLoaderConfig(JNDI_NAME));
      cache.createService();
View Full Code Here

         tx=null;
      }
   }

   TreeCache createCache(IsolationLevel level) throws Exception {
      TreeCache c=new TreeCache("test", null, 10000);
      c.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
      c.setLockAcquisitionTimeout(500);
      c.setIsolationLevel(level);
      c.createService();
      c.startService();
      return c;
   }
View Full Code Here

        }
    }

    public void testSingleLoaderNoPurge() throws Exception
    {
        cache = new TreeCache();
        cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp")+ "/" + "CacheLoaderPurgingTest", false, false, false));
        cache.startService();

        cache.put(fqn, key, value);
View Full Code Here

        assertEquals(value, loader.get(fqn).get(key));
    }

    public void testSingleLoaderPurge() throws Exception
    {
        cache = new TreeCache();
        cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", "org.jboss.cache.loader.FileCacheLoader", "location=" + System.getProperty("java.io.tmpdir", "/tmp") +"/" + "CacheLoaderPurgingTest", false, false, false, true));
        cache.startService();

        cache.put(fqn, key, value);
View Full Code Here

        assertNull(loader.get(fqn));
    }

    public void testTwoLoadersPurge() throws Exception
    {
        cache = new TreeCache();

        String xml = "<config>\n" +
                "<passivation>false</passivation>\n" +
                "<preload></preload>\n" +
                "<cacheloader>\n" +
View Full Code Here

         tx=null;
      }
   }

   TreeCache createCache(IsolationLevel level) throws Exception {
      TreeCache c=new TreeCache("test", null, 10000);
      c.setTransactionManagerLookupClass("org.jboss.cache.JBossTransactionManagerLookup");
      c.setLockAcquisitionTimeout(500);
      c.setIsolationLevel(level);
      c.createService();
      c.startService();
      return c;
   }
View Full Code Here

   }



   TreeCache createCache(int mode, IsolationLevel level) throws Exception {
      TreeCache c=new TreeCache();
      c.setCacheMode(mode);
      c.setIsolationLevel(level);
      c.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
      c.createService();
      c.startService();
      return c;
   }
View Full Code Here

      configureCache("");
   }

   protected void configureCache(String props) throws Exception
   {
       cache = new TreeCache();
       cache.setCacheMode(TreeCache.LOCAL);
       cache.setCacheLoaderConfiguration(getSingleCacheLoaderConfig("", DummyInMemoryCacheLoader.class.getName(), props, true, false, true));
       cache.create();
       cache.start();
   }
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.