Package org.jboss.cache.config

Examples of org.jboss.cache.config.Configuration.clone()


      {
         Configuration c = new Configuration();
         c.setCacheMode(CacheMode.REPL_SYNC);
         c.setNodeLockingScheme(NodeLockingScheme.MVCC);
         cache1 = new UnitTestCacheFactory<String, byte[]>().createCache(c.clone(), getClass());
         cache2 = new UnitTestCacheFactory<String, byte[]>().createCache(c.clone(), getClass());

         TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);

         cache1.put(Fqn.fromString("/a"), "test", b);
         byte[] bytesBack = cache2.get(Fqn.fromString("/a"), "test");
View Full Code Here


      c.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      c.setEvictionConfig(ec);

      c1 = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
      c2 = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), false, getClass());

      c1.start();
      c2.start();
      ec1 = new EvictionController(c1);
      ec2 = new EvictionController(c2);
View Full Code Here

   {
      Configuration c = UnitTestConfigurationFactory.createConfiguration(CacheMode.LOCAL);
      String props = "bin=" + getClass().getName();
      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "/a", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      cache.put(fqn, key, value);
      assertExists();

      cache.destroy();
View Full Code Here

      cache.put(fqn, key, value);
      assertExists();

      cache.destroy();

      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      assertExists();
   }

   public void testPreloadMultiRegions() throws Exception
   {
View Full Code Here

   {
      Configuration c = UnitTestConfigurationFactory.createConfiguration(CacheMode.LOCAL);
      String props = "bin=" + getClass().getName();
      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "/a", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      cache.put(fqn, key, value);
      assertExists();

      cache.destroy();
View Full Code Here

      cache.destroy();

      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "/c,/a,/b", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      assertExists();

      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "/c, /a, /b", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
View Full Code Here

      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      assertExists();

      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "/c, /a, /b", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      assertExists();

      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "  /c,   /a,   /b", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
View Full Code Here

      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      assertExists();

      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "  /c,   /a,   /b", DummySharedInMemoryCacheLoader.class.getName(),
            props, false, false, false, false, false));
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), getClass());
      assertExists();
   }

   private void assertExists() throws Exception
   {
View Full Code Here

          throw new IllegalArgumentException("unknown config " + configName);
       
       // Don't hand out a ref to our master copy
       try
       {
          return config.clone();
       }
       catch (CloneNotSupportedException e)
       {
          // This should not happen, as we already cloned the config
          throw new RuntimeException("Could not clone configuration " + configName, e);
View Full Code Here

         XmlConfigurationParser parser = new XmlConfigurationParser();
         Configuration c = parser.parseElementIgnoringRoot(element);

         // Prove that we can successfully clone it
         c = c.clone();
         result.put(name.trim(), c);
      }

      return result;
   }
View Full Code Here

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.