Package org.infinispan.config

Examples of org.infinispan.config.CacheLoaderManagerConfig.addCacheLoaderConfig()


      clMngrConfig.addCacheLoaderConfig(createCacheStoreConfig(1));
      config1.setCacheLoaderManagerConfig(clMngrConfig);

      Configuration config2 = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);
      CacheLoaderManagerConfig clMngrConfig2 = new CacheLoaderManagerConfig();
      clMngrConfig2.addCacheLoaderConfig(createCacheStoreConfig(2));
      config2.setCacheLoaderManagerConfig(clMngrConfig2);

      cacheManager1.defineConfiguration("clusteredFileCacheStore", config1);
      cacheManager2.defineConfiguration("clusteredFileCacheStore", config2);
      cache1 = cache(0, "clusteredFileCacheStore");
View Full Code Here


                                for (Property property: store.get(ModelKeys.PROPERTY).asPropertyList()) {
                                    properties.setProperty(property.getName(), property.getValue().asString());
                                }
                                ((AbstractCacheStoreConfig) storeConfig).setProperties(properties);
                            }
                            storeManagerConfig.addCacheLoaderConfig(storeConfig);
                        }
                        configs.put(cacheName, config);
                    }
                    if (!configs.containsKey(defaultCache)) {
                        throw new IllegalArgumentException(String.format("%s is not a valid default cache. The %s cache container does not contain a cache with that name", defaultCache, name));
View Full Code Here

      NodeList cacheLoaderNodes = element.getElementsByTagName("loader");
      for (int i = 0; i < cacheLoaderNodes.getLength(); i++) {
         Element indivElement = (Element) cacheLoaderNodes.item(i);
         CacheLoaderConfig iclc = parseIndividualCacheLoaderConfig(indivElement);
         cacheLoaderConfig.addCacheLoaderConfig(iclc);
      }
      return cacheLoaderConfig;
   }

   private CacheLoaderConfig parseIndividualCacheLoaderConfig(Element indivElement) {
View Full Code Here

      DummyInMemoryCacheStore.Cfg cfg = new DummyInMemoryCacheStore.Cfg();

      CacheLoaderManagerConfig clManagerConfig = new CacheLoaderManagerConfig();
      clManagerConfig.setPassivation(false);
      clManagerConfig.addCacheLoaderConfig(cfg);
      Configuration configuration = getDefaultClusteredConfig(Configuration.CacheMode.LOCAL);
      configuration.setExposeJmxStatistics(true);
      configuration.setCacheLoaderManagerConfig(clManagerConfig);

      cacheManager.defineConfiguration("test", configuration);
View Full Code Here

   public void setUp() {
      cm = TestCacheManagerFactory.createLocalCacheManager(false);
      Configuration c = new Configuration();
      CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
      DummyInMemoryCacheStore.Cfg clc = new DummyInMemoryCacheStore.Cfg("no_passivation");
      clmc.addCacheLoaderConfig(clc);
      c.setCacheLoaderManagerConfig(clmc);
      cm.defineConfiguration("no_passivation", c);

      c = c.clone();
      ((DummyInMemoryCacheStore.Cfg) c.getCacheLoaderManagerConfig().getFirstCacheLoaderConfig()).setStoreName("passivation");
View Full Code Here

   @Override
   protected void createCacheManagers() throws Throwable {
      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
      clmc.addCacheLoaderConfig(new DummyInMemoryCacheStore.Cfg("ReplicatedSharedEvictingLoaderTest"));
      clmc.setShared(true);
      clmc.setPassivation(true);
      c.setCacheLoaderManagerConfig(clmc);
      createCluster(c, 2);
      waitForClusterToForm();
View Full Code Here

   }

   public void testPreloadAndExpiry() {
      CacheLoaderManagerConfig cacheLoaders = new CacheLoaderManagerConfig();
      cacheLoaders.setPreload(true);
      cacheLoaders.addCacheLoaderConfig(csConfig);
      Configuration cfg = TestCacheManagerFactory.getDefaultConfiguration(false);
      cfg.setCacheLoaderManagerConfig(cacheLoaders);
      CacheContainer local = TestCacheManagerFactory.createCacheManager(cfg);
      try {
         Cache<String, String> cache = local.getCache();
View Full Code Here

   }

   public void testPreloadStoredAsBinary() {
      CacheLoaderManagerConfig cacheLoaders = new CacheLoaderManagerConfig();
      cacheLoaders.setPreload(true);
      cacheLoaders.addCacheLoaderConfig(csConfig);
      Configuration cfg = TestCacheManagerFactory.getDefaultConfiguration(false);
      cfg.setUseLazyDeserialization(true);
      cfg.setCacheLoaderManagerConfig(cacheLoaders);
      CacheContainer local = TestCacheManagerFactory.createCacheManager(cfg);
      try {
View Full Code Here

      Configuration conf = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC);
      DummyInMemoryCacheStore.Cfg cfg = new DummyInMemoryCacheStore.Cfg();
      cfg.setStoreName("Store-" + storeCounter.getAndIncrement());
      CacheLoaderManagerConfig pushingCfg = new CacheLoaderManagerConfig();
      pushingCfg.addCacheLoaderConfig(cfg);
      SingletonStoreConfig ssc = new SingletonStoreConfig();
      ssc.setPushStateWhenCoordinator(true);
      ssc.setSingletonStoreEnabled(true);
      cfg.setSingletonStoreConfig(ssc);
      conf.setCacheLoaderManagerConfig(pushingCfg);
View Full Code Here

      conf = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC);
      cfg = new DummyInMemoryCacheStore.Cfg();
      cfg.setStoreName("Store-" + storeCounter.getAndIncrement());
      CacheLoaderManagerConfig nonPushingCfg = new CacheLoaderManagerConfig();
      nonPushingCfg.addCacheLoaderConfig(cfg);
      ssc = new SingletonStoreConfig();
      ssc.setPushStateWhenCoordinator(false);
      ssc.setSingletonStoreEnabled(true);
      cfg.setSingletonStoreConfig(ssc);
      conf.setCacheLoaderManagerConfig(nonPushingCfg);
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.