Package org.jboss.cache.config

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


      Configuration c = new Configuration();
      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_ASYNC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      TestingUtil.blockUntilViewReceived(cache1, 2, 10000);
      registerCaches(cache1, cache2);
   }

   public void testPessTxAsyncUnableToEvict() throws Exception
View Full Code Here


      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      c.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      TestingUtil.blockUntilViewReceived(cache1, 2, 10000);
      registerCaches(cache1, cache2);

   }
View Full Code Here

      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      c.setCacheLoaderConfig(CacheLoaderInvalidationTest.getCacheLoaderConfig(getClass()));
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      registerCaches(cache1, cache2);
   }

   @BeforeMethod
   public void clearCacheLoaderBetweenTests() throws Exception
View Full Code Here

      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      conf.setBuddyReplicationConfig(brc);

      c1 = cf.createCache(conf, false, getClass());
      c2 = cf.createCache(conf.clone(), false, getClass());
      c3 = cf.createCache(conf.clone(), false, getClass());

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

      brc.setEnabled(true);
      conf.setBuddyReplicationConfig(brc);

      c1 = cf.createCache(conf, false, getClass());
      c2 = cf.createCache(conf.clone(), false, getClass());
      c3 = cf.createCache(conf.clone(), false, getClass());

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

      Configuration c = new Configuration();
      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      TestingUtil.blockUntilViewReceived(cache1, 2, 10000);
      registerCaches(cache1, cache2);
   }

   public void testPessimisticNonTransactional() throws Exception
View Full Code Here

      Cache<String, String> c1 = null, c2 = null;
      try
      {
         Configuration cfg = UnitTestConfigurationFactory.createConfiguration(CacheMode.INVALIDATION_SYNC, false);
         cfg.setNodeLockingScheme(NodeLockingScheme.MVCC);
         c1 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone(), getClass());
         c2 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone(), getClass());
         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 = UnitTestConfigurationFactory.createConfiguration(CacheMode.INVALIDATION_SYNC, false);
         cfg.setNodeLockingScheme(NodeLockingScheme.MVCC);
         c1 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone(), getClass());
         c2 = new UnitTestCacheFactory<String, String>().createCache(cfg.clone(), getClass());
         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

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

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

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

      cache1.addCacheListener(eventLog1);
View Full Code Here

      try
      {
         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);
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.