Examples of CacheLoaderConfig


Examples of org.infinispan.loader.CacheLoaderConfig

      if (loader instanceof CacheStore) stores.put((CacheStore) loader, config);
   }

   public void purgeIfNecessary() throws CacheLoaderException {
      for (Map.Entry<CacheStore, CacheLoaderConfig> e : stores.entrySet()) {
         CacheLoaderConfig value = e.getValue();
         if (value instanceof CacheStoreConfig && ((CacheStoreConfig) value).isPurgeOnStartup())
            e.getKey().clear();
      }
   }
View Full Code Here

Examples of org.infinispan.loaders.CacheLoaderConfig

   @Override
   public void init(CacheLoaderConfiguration config, Cache<?, ?> cache, StreamingMarshaller m) throws CacheLoaderException {
      this.configuration = validateConfigurationClass(config, LegacyStoreConfiguration.class);
      super.init(config, cache, m);

      CacheLoaderConfig legacy = Util.getInstance(configuration.cacheStore().getClass().getAnnotation(CacheLoaderMetadata.class).configurationClass());
      if (legacy instanceof AbstractCacheLoaderConfig) {
         AbstractCacheLoaderConfig aclc = (AbstractCacheLoaderConfig) legacy;
         aclc.setProperties(configuration.properties());
      }
      XmlConfigHelper.setValues(legacy, configuration.properties(), false, true);
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

{
   protected void configureCache(CacheSPI cache) throws Exception
   {
      // use the shared variation of the DIMCL so that state is persisted in a static variable in memory rather than an
      // instance one.
      CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummySharedInMemoryCacheLoader.class.getName(),
            "debug=true \n bin=" + getClass().getName(), false, true, false, false, false);
      cache.getConfiguration().setCacheLoaderConfig(clc);
      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

                  "                      purgeOnStartup=\"false\">\n" +
                  "                <properties>bin=" + getClass()+ "bin2</properties>\n" +
                  "         </loader>" +
                  "      </loaders>";
      LoadersElementParser parser = new LoadersElementParser();
      CacheLoaderConfig cacheLoaderConfig = parser.parseLoadersElement(XmlConfigHelper.stringToElementInCoreNS(xml));
      Configuration c = cache.getConfiguration();
      c.setCacheLoaderConfig(cacheLoaderConfig);
      cache.start();

      cache.put(fqn, key, value);
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.MVCC);
      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);

      String binName = "bin-" + Thread.currentThread().getName();

      CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummySharedInMemoryCacheLoader.class.getName(),
            "debug=true\nbin=" + binName, false, true, false, false, false);
      clc.setPassivation(true);
      cache.getConfiguration().setCacheLoaderConfig(clc);
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   }

   protected CacheLoaderConfig getCacheLoaderConfig(String loc1, String loc2) throws Exception
   {
      CacheLoaderConfig clc = new CacheLoaderConfig();
      // clc 1
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(DummySharedInMemoryCacheLoader.class.getName());
      iclc.setAsync(false);
      iclc.setFetchPersistentState(true);
      iclc.setPurgeOnStartup(false);
      iclc.setIgnoreModifications(false);
      iclc.setProperties("bin=" + loc1);
      clc.addIndividualCacheLoaderConfig(iclc);

      IndividualCacheLoaderConfig iclc2 = iclc.clone();
      iclc2.setFetchPersistentState(false);
      iclc2.setProperties("bin=" + loc2);
      clc.addIndividualCacheLoaderConfig(iclc2);
      clc.setPassivation(false);
      clc.setShared(false);
      return clc;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      p.setProperty("cache.jdbc.table.name", prop.getProperty("cache.jdbc.table.name"));
      p.setProperty("cache.jdbc.table.primarykey", prop.getProperty("cache.jdbc.table.primarykey"));
      JDBCCacheLoaderConfig jdbcConfig = new JDBCCacheLoaderConfig();
      jdbcConfig.setFetchPersistentState(true);
      jdbcConfig.setProperties(p);
      CacheLoaderConfig config = new CacheLoaderConfig();
      config.addIndividualCacheLoaderConfig(jdbcConfig);
      cache.getConfiguration().setCacheLoaderConfig(config);
      cache.create();
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   }


   public Cache<String, String> init(boolean passivation) throws Exception
   {
      CacheLoaderConfig cacheLoaderConfig = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(passivation, "", DummyInMemoryCacheLoader.class.getName(), "", false, true, false, false, false);
      Configuration cfg = new Configuration();
      cfg.setNodeLockingScheme(getNodeLockingScheme());
      cfg.setCacheLoaderConfig(cacheLoaderConfig);
      cfg.getRuntimeConfig().setTransactionManager(new DummyTransactionManager());
      Cache<String, String> cache = new UnitTestCacheFactory().createCache(cfg, getClass());
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      return new ActiveStatusModifier(mscl);
   }

   protected CacheLoaderConfig getSingletonStoreCacheLoaderConfig(String cacheloaderClass, boolean isPush) throws Exception
   {
      CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, null, cacheloaderClass, "", false, false, false, false, false);
      CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig sc = new CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig();
      sc.setSingletonStoreEnabled(true);
      sc.setProperties("pushStateWhenCoordinator = " + isPush + "\n pushStateWhenCoordinatorTimeout = 50000\n");
      clc.getFirstCacheLoaderConfig().setSingletonStoreConfig(sc);
      return clc;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      return clc;
   }

   protected CacheLoaderConfig getSingletonStoreCacheLoaderConfig(String cacheloaderClass, String singletonStoreClass) throws Exception
   {
      CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, null, cacheloaderClass, "", false, false, false, false, false);
      CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig sc = new CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig();
      sc.setSingletonStoreEnabled(true);
      sc.setSingletonStoreClass(singletonStoreClass);
      sc.setProperties("pushStateWhenCoordinator = true\n pushStateWhenCoordinatorTimeout = 50000\n");
      clc.getFirstCacheLoaderConfig().setSingletonStoreConfig(sc);
      return clc;
   }
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.