Package org.infinispan.manager

Examples of org.infinispan.manager.CacheManager


    * Uses a default clustered cache manager global config.
    *
    * @return the new CacheManager
    */
   protected CacheManager addClusterEnabledCacheManager() {
      CacheManager cm = TestCacheManagerFactory.createClusteredCacheManager();
      cacheManagers.add(cm);
      return cm;
   }
View Full Code Here


   }

   protected <K, V> List<Cache<K, V>> createClusteredCaches(int numMembersInCluster, String cacheName, Configuration c) {
      List<Cache<K, V>> caches = new ArrayList<Cache<K, V>>(numMembersInCluster);
      for (int i = 0; i < numMembersInCluster; i++) {
         CacheManager cm = addClusterEnabledCacheManager();
         cm.defineCache(cacheName, c);
         Cache<K, V> cache = cm.getCache(cacheName);
         caches.add(cache);
      }
      TestingUtil.blockUntilViewsReceived(10000, caches);
      return caches;
   }
View Full Code Here

   protected CacheManager createCacheManager() throws Exception {
      // start a single cache instance
      Configuration c = new Configuration();
      c.setIsolationLevel(getIsolationLevel());
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
      cm.defineCache("test", c);
      cache = cm.getCache("test");
      return cm;
   }
View Full Code Here

@Test(groups = "functional", testName = "api.AsyncAPITest")
public class AsyncAPITest extends SingleCacheManagerTest {
   Cache<String, String> c;

   protected CacheManager createCacheManager() throws Exception {
      CacheManager cm = TestCacheManagerFactory.createLocalCacheManager();
      c = cm.getCache();
      return cm;
   }
View Full Code Here

   protected void createCacheManagers() throws Throwable {
      GlobalConfiguration globalConfiguration = GlobalConfiguration.getClusteredDefault();
      globalConfiguration.setReplicationQueueScheduledExecutorFactoryClass(ReplQueueTestScheduledExecutorFactory.class.getName());
      globalConfiguration.setReplicationQueueScheduledExecutorProperties(ReplQueueTestScheduledExecutorFactory.myProps);
      CacheManager first = TestCacheManagerFactory.createCacheManager(globalConfiguration);
      CacheManager second = TestCacheManagerFactory.createCacheManager(globalConfiguration);
      registerCacheManager(first, second);

      Configuration config = getDefaultClusteredConfig(Configuration.CacheMode.REPL_ASYNC);
      config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      config.setUseReplQueue(true);
View Full Code Here

      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.LOCAL);
      c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());

      CacheManager cm = TestCacheManagerFactory.createCacheManager(c);

      cache = cm.getCache();
      tm = TestingUtil.getTransactionManager(cache);
      mockNotifier = createMock(CacheNotifier.class);
      origNotifier = TestingUtil.replaceComponent(cache, CacheNotifier.class, mockNotifier, true);
   }
View Full Code Here

public class TransactionsSpanningCaches extends SingleCacheManagerTest {

   protected CacheManager createCacheManager() throws Exception {
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      CacheManager cm = TestCacheManagerFactory.createCacheManager(c);
      cm.defineCache("c1", c);
      cm.defineCache("c2", c);
      return cm;
   }
View Full Code Here

      LockTestBaseTL tl = new LockTestBaseTL();
      Configuration defaultCfg = new Configuration();
      defaultCfg.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      defaultCfg.setIsolationLevel(repeatableRead ? IsolationLevel.REPEATABLE_READ : IsolationLevel.READ_COMMITTED);
      defaultCfg.setLockAcquisitionTimeout(200); // 200 ms
      CacheManager cm = TestCacheManagerFactory.createCacheManager(defaultCfg);
      tl.cache = cm.getCache();
      tl.lockManager = TestingUtil.extractComponentRegistry(tl.cache).getComponent(LockManager.class);
      tl.icc = TestingUtil.extractComponentRegistry(tl.cache).getComponent(InvocationContextContainer.class);
      tl.tm = TestingUtil.extractComponentRegistry(tl.cache).getComponent(TransactionManager.class);
      threadLocal.set(tl);
   }
View Full Code Here

   public void setUp() throws Exception {
      // start a single cache instance
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      c.setInvocationBatchingEnabled(true);
      CacheManager cm = TestCacheManagerFactory.createCacheManager(c);

      Cache flatcache = cm.getCache();
      cache = new TreeCacheImpl(flatcache);

      tm = TestingUtil.getTransactionManager(flatcache);
   }
View Full Code Here

public class MarkAsRollbackTest extends SingleCacheManagerTest {

   protected CacheManager createCacheManager() throws Exception {
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      CacheManager cm = TestCacheManagerFactory.createCacheManager(c);
      cache = cm.getCache();
      return cm;
   }
View Full Code Here

TOP

Related Classes of org.infinispan.manager.CacheManager

Copyright © 2018 www.massapicom. 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.