Package org.infinispan.manager

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


  
   @Override
   public boolean isDistributed()
   {
      EmbeddedCacheManager container = (EmbeddedCacheManager) this.container;
      Configuration config = (this.cacheName != null) ? container.defineConfiguration(this.cacheName, new Configuration()) : container.getDefaultConfiguration();
      return config.getCacheMode().isDistributed();
   }
  
   /**
    * {@inheritDoc}
 
View Full Code Here


//    Cache defaultCache = manager.getCache();
   
    Configuration c = new ConfigurationBuilder().clustering().cacheMode(CacheMode.REPL_SYNC).build();
   
    String newCacheName = "repl";
    manager.defineConfiguration(newCacheName, c);
    Cache<String, String> cache = manager.getCache(newCacheName);
  }

}
View Full Code Here

  Cache<Object, Object> cache;

  @Before
  public void setup() {
    EmbeddedCacheManager manager = new DefaultCacheManager();
    manager.defineConfiguration("custom-cache", new ConfigurationBuilder()
        .eviction().strategy(EvictionStrategy.LIRS).maxEntries(10)
        .build());
    cache = manager.getCache("custom-cache");
  }
View Full Code Here

  public static void main(String[] args) {
   
    EmbeddedCacheManager manager = new DefaultCacheManager();
   
    manager.defineConfiguration("named-cache", new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LIRS).maxEntries(10).build());
   
    Cache<Object, Object> cache = manager.getCache("named-cache");
   
    for (int i = 0; i < 10; i++) {
      cache.put("key-" + i, new User(i, "Kylin Soong", "IT"));
View Full Code Here

      ConfigurationBuilder builder = getDefaultStandaloneCacheConfig(true);
      builder.indexing().enable().indexLocalOnly(false)
            .addProperty("default.directory_provider", "ram")
            .addProperty("lucene_version", "LUCENE_CURRENT");

      cm.defineConfiguration(CACHE_NAME, builder.build());
      return cm;
   }

   @Override
   protected void setup() throws Exception {
View Full Code Here

            .addProperty("lucene_version", "LUCENE_36");

      enhanceConfig(cacheCfg);

      cm1.defineConfiguration("perfConf", cacheCfg.build());
      cm2.defineConfiguration("perfConf", cacheCfg.build());

      cache1 = cm1.getCache("perfConf");
      cache2 = cm2.getCache("perfConf");
   }
}
View Full Code Here

      for(Object cache : caches) {
         Cache cacheObj = (Cache) cache;
         EmbeddedCacheManager cm1 = cacheObj.getCacheManager();
         ConfigurationBuilder cacheCfg1 = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false);
         cacheCfg1.clustering().stateTransfer().fetchInMemoryState(true);
         cm1.defineConfiguration(InfinispanIntegration.DEFAULT_INDEXESDATA_CACHENAME, cacheCfg1.build());
         cm1.defineConfiguration(InfinispanIntegration.DEFAULT_LOCKING_CACHENAME, cacheCfg1.build());

         cacheManagers.add(cm1);
      }
View Full Code Here

         Cache cacheObj = (Cache) cache;
         EmbeddedCacheManager cm1 = cacheObj.getCacheManager();
         ConfigurationBuilder cacheCfg1 = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false);
         cacheCfg1.clustering().stateTransfer().fetchInMemoryState(true);
         cm1.defineConfiguration(InfinispanIntegration.DEFAULT_INDEXESDATA_CACHENAME, cacheCfg1.build());
         cm1.defineConfiguration(InfinispanIntegration.DEFAULT_LOCKING_CACHENAME, cacheCfg1.build());

         cacheManagers.add(cm1);
      }

      waitForClusterToForm(neededCacheNames);
View Full Code Here

      configurationBuilder.locking().useLockStriping(false); // reduces the odd chance of a key collision and deadlock
   }

   protected EmbeddedCacheManager createCacheManager() {
      EmbeddedCacheManager cm = addClusterEnabledCacheManager(new TransportFlags().withMerge(true));
      cm.defineConfiguration(cacheName, configurationBuilder.build());
      return cm;
   }

   public static class DelayTransfer implements Serializable {
View Full Code Here

      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

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.