Examples of defineConfiguration()


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

//    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

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

  public static void main(String[] args) {

    Configuration configuration = new ConfigurationBuilder().clustering().cacheMode(CacheMode.LOCAL).build();
    DefaultCacheManager cacheManager = new DefaultCacheManager();
    String newCacheName = "repl";
    cacheManager.defineConfiguration(newCacheName, configuration);
    Cache<String, String> cache = cacheManager.getCache(newCacheName);
    AdvancedCache advancedCache = cache.getAdvancedCache();
    advancedCache.withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.SKIP_CACHE_LOAD).put("local", "only");
    advancedCache.addInterceptor(new CustomCommandInterceptor(), 0);
    System.out.println(advancedCache.getName());
View Full Code Here

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

  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

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

  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

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

    assertEquals(PERSISTENCE_UNIT_NAME, jpaCacheLoaderConfig.persistenceUnitName());
    assertEquals(User.class, jpaCacheLoaderConfig.entityClass());

    EmbeddedCacheManager cacheManager = new DefaultCacheManager(globalConfig);

    cacheManager.defineConfiguration("userCache", cacheConfig);

    cacheManager.start();
    Cache<String, User> userCache = cacheManager.getCache("userCache");
    User user = new User();
    user.setUsername("rtsang");
View Full Code Here

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

      final EmbeddedCacheManager nativeEmbeddedCacheManager = new DefaultCacheManager(
               templateConfiguration.globalConfiguration,
               templateConfiguration.defaultConfiguration);
      for (final Map.Entry<String, Configuration> namedCacheConfig : templateConfiguration.namedCaches
               .entrySet()) {
         nativeEmbeddedCacheManager.defineConfiguration(namedCacheConfig.getKey(),
                  namedCacheConfig.getValue());
      }

      return nativeEmbeddedCacheManager;
   }
View Full Code Here

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

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

//    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

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

  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

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

  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
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.