Package org.jboss.cache.config

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


            XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
            c = oldParser.parseConfiguration(element);
         }

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

      return result;
   }
View Full Code Here


            XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
            c = oldParser.parseConfiguration(element);
         }

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

      return result;
   }
View Full Code Here

      // more time to help with debugging
      c.setSyncReplTimeout(60000);

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache1 = instance.createCache(c);
      cache2 = instance.createCache(c.clone());

      eventLog1.events.clear();
      eventLog2.events.clear();

      cache1.addCacheListener(eventLog1);
View Full Code Here

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

      cache1 = new DefaultCacheFactory().createCache(c, false);
      cache2 = new DefaultCacheFactory().createCache(c.clone(), false);
   }

   @AfterTest
   public void tearDown()
   {
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

            XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
            c = oldParser.parseConfiguration(element);
         }

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

      return result;
   }
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

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.