Package org.infinispan.manager

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


      JoiningNode node = new JoiningNode(createCacheManager());
      cache2 = node.getCache(cacheName);
      node.waitForJoin(60000, cache1, cache2);
      node.verifyStateTransfer(new CacheVerifier(cache2));

      cacheManager1.defineConfiguration("otherCache", configurationBuilder.build());
      cacheManager1.getCache("otherCache");
      logTestEnd(m);
   }

   public void testConcurrentStateTransfer(Method m) throws Exception {
View Full Code Here


         // create a new cache, make sure it joins properly
         Configuration c = getDefaultClusteredConfig(cacheMode);
         c.fluent()
               .clustering().stateRetrieval().fetchInMemoryState(true);
         EmbeddedCacheManager cm = addClusterEnabledCacheManager(new TransportFlags());
         cm.defineConfiguration(cacheName, c);
         Cache cache2 = cm.getCache(cacheName);
         assert cache2.getAdvancedCache().getRpcManager().getTransport().getMembers().size() == 3;

         assert "v1".equals(cache1.get("k1"));
         assert "v2".equals(cache1.get("k2"));
View Full Code Here

      CacheLoaderManagerConfig clMngrConfig2 = new CacheLoaderManagerConfig();
      clMngrConfig2.addCacheLoaderConfig(createCacheStoreConfig(2));
      config2.setCacheLoaderManagerConfig(clMngrConfig2);

      cacheManager1.defineConfiguration("clusteredFileCacheStore", config1);
      cacheManager2.defineConfiguration("clusteredFileCacheStore", config2);
      cache1 = cache(0, "clusteredFileCacheStore");
      cache2 = cache(1, "clusteredFileCacheStore");
   }

   public void testRestoreTransactionalAtomicMap(Method m) throws Exception{
View Full Code Here

      GlobalConfigurationBuilder globalConfigurationBuilder = GlobalConfigurationBuilder.defaultClusteredBuilder();
      globalConfigurationBuilder.transport().machineId("a").rackId("b").siteId("test1");

      EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager(globalConfigurationBuilder,
                                                                                     builder);
      cm1.defineConfiguration(cacheName(), builder.build());
      cacheManagers.add(cm1);

      globalConfigurationBuilder = GlobalConfigurationBuilder.defaultClusteredBuilder();
      globalConfigurationBuilder.transport().machineId("b").rackId("b").siteId("test2");
      EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager(globalConfigurationBuilder,
View Full Code Here

      globalConfigurationBuilder = GlobalConfigurationBuilder.defaultClusteredBuilder();
      globalConfigurationBuilder.transport().machineId("b").rackId("b").siteId("test2");
      EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager(globalConfigurationBuilder,
                                                                                     builder);

      cm2.defineConfiguration(cacheName(), builder.build());
      cacheManagers.add(cm2);

      waitForClusterToForm(cacheName());
   }
View Full Code Here

      DummyInMemoryCacheStore cs = (DummyInMemoryCacheStore) TestingUtil.extractComponent(c1, CacheLoaderManager.class).getCacheStore();
      assert cs.loadAllKeys(Collections.emptySet()).size() == NUM_KEYS;

      addClusterEnabledCacheManager();
      EmbeddedCacheManager cm2 = cacheManagers.get(1);
      cm2.defineConfiguration(cacheName, buildConfiguration().build());
      c2 = cache(1, cacheName);
      waitForClusterToForm();

      DataContainer dc2 = c2.getAdvancedCache().getDataContainer();
      assertEquals("Expected all the cache store entries to be preloaded on the second cache", NUM_KEYS, dc2.size());
View Full Code Here

      EmbeddedCacheManager manager = new DefaultCacheManager(globalConfiguration, configuration.getDefaultConfiguration(), false);

      // Add named configurations
      for (Configuration config: configuration.getNamedConfigurations())
      {
         manager.defineConfiguration(config.getName(), config);
      }
     
      return manager;
   }
  
View Full Code Here

      EmbeddedCacheManager manager = new DefaultCacheManager(globalConfiguration, configuration.getDefaultConfiguration(), false);

      // Add named configurations
      for (Configuration config: configuration.getConfigurations())
      {
         manager.defineConfiguration(config.getName(), config);
      }
     
      manager.start();
     
      return (aliases != null) && !aliases.isEmpty() ? new AliasAwareCacheContainer(manager, aliases) : manager;
View Full Code Here

        try {
            EmbeddedCacheManager manager = new DefaultCacheManager(this.globalConfiguration, this.defaultConfiguration, false);

            // Add named configurations
            for (Map.Entry<String, Configuration> entry: this.configurations.entrySet()) {
               manager.defineConfiguration(entry.getKey(), entry.getValue());
            }

            this.container = new DefaultCacheContainer(manager, this.defaultCache);
            this.container.start();
        } finally {
View Full Code Here

    assertEquals(tmpExpiredDirectory, leveldbConfig.expiredLocation());

    EmbeddedCacheManager cacheManager = new DefaultCacheManager(
        globalConfig);

    cacheManager.defineConfiguration("testCache", cacheConfig);

    cacheManager.start();
    Cache<String, String> cache = cacheManager.getCache("testCache");
   
    cache.put("hello", "there");
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.