Package org.jboss.cache.config

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


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

         TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);

         cache1.put(Fqn.fromString("/a"), "test", b);
View Full Code Here


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

         TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);

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

      Cache<String, String> c1 = null, c2 = null;
      try
      {
         Configuration cfg = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.INVALIDATION_SYNC, false);
         cfg.setNodeLockingScheme(NodeLockingScheme.MVCC);
         c1 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone());
         c2 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone());
         EventLog eventLog = new EventLog();
         c2.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
         c2.put("/a/b/c", "x", "y");
         c2.addCacheListener(eventLog);
View Full Code Here

      try
      {
         Configuration cfg = UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.INVALIDATION_SYNC, false);
         cfg.setNodeLockingScheme(NodeLockingScheme.MVCC);
         c1 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone());
         c2 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone());
         EventLog eventLog = new EventLog();
         c2.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
         c2.put("/a/b/c", "x", "y");
         c2.addCacheListener(eventLog);
         c1.put("/a/b/c", "k", "v");
View Full Code Here

         clc.addIndividualCacheLoaderConfig(iclc);

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

         c1 = cf.createCache(cfg.clone());
         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());
         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 = cf.createCache(cfg.clone());
         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());
         assert c2.get(fqn, k).equals(v);
         assert getLoader(c2).get(fqn) == null;
      }
      finally
      {
View Full Code Here

      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      conf.setBuddyReplicationConfig(brc);
     
      c1 = cf.createCache(conf, false);
      c2 = cf.createCache(conf.clone(), false);
      c3 = cf.createCache(conf.clone(), false);

      c1.start();
      c2.start();
      c3.start();
View Full Code Here

      brc.setEnabled(true);
      conf.setBuddyReplicationConfig(brc);
     
      c1 = cf.createCache(conf, false);
      c2 = cf.createCache(conf.clone(), false);
      c3 = cf.createCache(conf.clone(), false);

      c1.start();
      c2.start();
      c3.start();
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.