Package org.infinispan.manager

Examples of org.infinispan.manager.EmbeddedCacheManager.defineConfiguration()


   @Override
   protected void createCacheManagers() throws Throwable {
      Configuration cfg = createConfiguration(1);
      EmbeddedCacheManager cm = addClusterEnabledCacheManager();
      cm.defineConfiguration("onlyFetchPersistent", cfg);
   }

   private Configuration createConfiguration(int id) {
      Configuration cfg = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);
      cfg.fluent().clustering().stateRetrieval().fetchInMemoryState(false);
View Full Code Here


      assert !cache1.getConfiguration().isFetchInMemoryState();
      cache1.put("k-" + m.getName(), "v-" + m.getName());

      Configuration cfg2 = createConfiguration(2);
      EmbeddedCacheManager cm2 = addClusterEnabledCacheManager();
      cm2.defineConfiguration("onlyFetchPersistent", cfg2);

      Cache cache2 = cache(1, "onlyFetchPersistent");
      assert !cache2.getConfiguration().isFetchInMemoryState();
      assert cache2.containsKey("k-" + m.getName());
      assert cache2.get("k-" + m.getName()).equals("v-" + m.getName());
View Full Code Here

      EmbeddedCacheManager localCacheManager = TestCacheManagerFactory.createLocalCacheManager(false);
      try {
         CacheLoaderManagerConfig clmConfig = new CacheLoaderManagerConfig();
         clmConfig.addCacheLoader(csConfig);
         localCacheManager.getDefaultConfiguration().setCacheLoaderManagerConfig(clmConfig);
         localCacheManager.defineConfiguration("first", new Configuration());
         localCacheManager.defineConfiguration("second", new Configuration());
         cacheNames.add("first");
         cacheNames.add("second");

         Cache first = localCacheManager.getCache("first");
View Full Code Here

      try {
         CacheLoaderManagerConfig clmConfig = new CacheLoaderManagerConfig();
         clmConfig.addCacheLoader(csConfig);
         localCacheManager.getDefaultConfiguration().setCacheLoaderManagerConfig(clmConfig);
         localCacheManager.defineConfiguration("first", new Configuration());
         localCacheManager.defineConfiguration("second", new Configuration());
         cacheNames.add("first");
         cacheNames.add("second");

         Cache first = localCacheManager.getCache("first");
         Cache second = localCacheManager.getCache("second");
View Full Code Here

   }

   private void addNewCacheManagerAndWaitForRehash() {
      EmbeddedCacheManager cacheManager = addClusterEnabledCacheManager(getDefaultClusteredCacheConfig(
            CacheMode.DIST_SYNC, false));
      cacheManager.defineConfiguration(testCacheName, buildCfg(true));
      log.debug("\n\nstarted CacheManager #" + (getCacheManagers().size() - 1));
      waitForClusterToForm(testCacheName);
   }

   private Configuration buildCfg(boolean clustered) {
View Full Code Here

   private void putTestDataInCacheStore() {
      log.debug("Using cache store dir " + fileCacheStoreTmpDir);
      EmbeddedCacheManager cmForCacheStoreInit = TestCacheManagerFactory.createCacheManager(TestCacheManagerFactory
            .getDefaultConfiguration(true));
      try {
         cmForCacheStoreInit.defineConfiguration(testCacheName, buildCfg(false));

         Cache<String, String> cache = cmForCacheStoreInit.getCache(testCacheName);
         cache.put("key1", "one");
         cache.put("key2", "two");
         cache.put("key3", "three");
View Full Code Here

      ConfigurationBuilder cb = getDefaultStandaloneCacheConfig(true);
      cb.locking().isolationLevel(getIsolationLevel());
      addEviction(cb);
      amend(cb);
      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager(false);
      cm.defineConfiguration("test", cb.build());
      cache = cm.getCache("test");
      return cm;
   }

   protected void amend(ConfigurationBuilder cb) {
View Full Code Here

      registerCacheManager(cacheManager2);

      Configuration configuration = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);
      configuration.setExposeJmxStatistics(true);
      cacheManager1.defineConfiguration("test", configuration);
      cacheManager2.defineConfiguration("test", configuration.clone());
      cache1 = cacheManager1.getCache("test");
      cache2 = cacheManager2.getCache("test");
      txInterceptor = getCacheObjectName(JMX_DOMAIN, "test(repl_sync)", "Transactions");
      txInterceptor2 = getCacheObjectName(JMX_DOMAIN, "test(repl_sync)", "Transactions", "SecondDefaultCacheManager");
View Full Code Here

   protected EmbeddedCacheManager createCacheManager() throws Exception {
      // start a single cache instance
      ConfigurationBuilder dscb = getDefaultStandaloneCacheConfig(false);
      dscb.locking().supportsConcurrentUpdates(false);
      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager(false);
      cm.defineConfiguration("test", dscb.build());
      cache = cm.getCache("test");
      return cm;
   }

   public void testNonLockingInterceptor() {
View Full Code Here

      globalConfigurationBuilder.transport().machineId("m" + (machineId > 0 ? machineId : counter))
            .rackId("r" + (rackId > 0 ? rackId : counter)).siteId("s" + (siteId > 0 ? siteId : counter));

      EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager(globalConfigurationBuilder,
                                                                                     builder);
      cm1.defineConfiguration(CACHE_NAME, builder.build());

      return cm1;
   }

   public CacheMode getCacheMode() {
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.