Package org.jboss.cache.config

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


          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


         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

         clc.addIndividualCacheLoaderConfig(iclc);

         cfg.setCacheLoaderConfig(clc);
         cfg.setNodeLockingScheme(nls);

         c1 = cf.createCache(cfg.clone(), getClass());
         c1.put(fqn, k, v);

         assert c1.get(fqn, k).equals(v);
         assert getLoader(c1).get(fqn).get(k).equals(v);
View Full Code Here

         c1.put(fqn, k, v);

         assert c1.get(fqn, k).equals(v);
         assert getLoader(c1).get(fqn).get(k).equals(v);

         c2 = cf.createCache(cfg.clone(), getClass());
         assert c2.get(fqn, k).equals(v);
         assert getLoader(c2).get(fqn).get(k).equals(v);
      }
      finally
      {
View Full Code Here

         clc.setShared(true); // even though it isn't really a shared CL

         cfg.setCacheLoaderConfig(clc);
         cfg.setNodeLockingScheme(nls);

         c1 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone(), getClass());
         c1.put(fqn, k, v);

         assert c1.get(fqn, k).equals(v);
         assert getLoader(c1).get(fqn).get(k).equals(v);
View Full Code Here

         c1.put(fqn, k, v);

         assert c1.get(fqn, k).equals(v);
         assert getLoader(c1).get(fqn).get(k).equals(v);

         c2 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone(), getClass());
         assert c2.get(fqn, k).equals(v);
         assert getLoader(c2).get(fqn) == null;
      }
      finally
      {
View Full Code Here

      // Cache1 will be used only for recovery.
      // Cache2 will perform some updates on the objects and then fail.

      cache1 = new UnitTestCacheFactory<String, Integer>().createCache(c, false, getClass());
      cache2 = new UnitTestCacheFactory<String, Integer>().createCache(c.clone(), false, getClass());
   }

   @AfterMethod
   public void tearDown() throws Exception
   {
View Full Code Here

   public void setUp() throws CloneNotSupportedException
   {
      Configuration cacheCfg = new Configuration();
      cacheCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      cacheCfg.setFetchInMemoryState(false);
      cache1 = new DefaultCacheFactory().createCache(cacheCfg.clone());
      searchableCache1 = new SearchableCacheFactory().createSearchableCache(cache1, Person.class);

      cache2 = new DefaultCacheFactory().createCache(cacheCfg.clone());
      searchableCache2 = new SearchableCacheFactory().createSearchableCache(cache2, Person.class);
View Full Code Here

      cacheCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      cacheCfg.setFetchInMemoryState(false);
      cache1 = new DefaultCacheFactory().createCache(cacheCfg.clone());
      searchableCache1 = new SearchableCacheFactory().createSearchableCache(cache1, Person.class);

      cache2 = new DefaultCacheFactory().createCache(cacheCfg.clone());
      searchableCache2 = new SearchableCacheFactory().createSearchableCache(cache2, Person.class);

      // wait until both caches are started and can see each other on the network.
      long giveUpTime = System.currentTimeMillis() + (60 * 1000); // give up after 1 minute of waiting
      boolean wait = true;
View Full Code Here

          if (name == null || name.trim().length() == 0)
              throw new ConfigurationException("Element " + element + " has no name attribute");
           
          Configuration c = parser.parseConfiguration(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.