Package org.jboss.cache.config

Examples of org.jboss.cache.config.CacheLoaderConfig


      assertEquals("BR locator", "org.jboss.cache.buddyreplication.TestBuddyLocator", blc.getBuddyLocatorClass());
      Properties props = blc.getBuddyLocatorProperties();
      assertEquals("BR props", "2", props.get("numBuddies"));

      assertEquals("CacheLoaderConfig", getCacheLoaderConfig().toString(), wrapper.getCacheLoaderConfig().toString());
      CacheLoaderConfig clc = c.getCacheLoaderConfig();
      assertEquals("CL passivation", false, clc.isPassivation());
      assertEquals("CL passivation", true, clc.isShared());
      assertEquals("CL preload", "/foo", clc.getPreload());
      List<IndividualCacheLoaderConfig> iclcs = clc.getIndividualCacheLoaderConfigs();
      IndividualCacheLoaderConfig iclc = iclcs.get(0);
      assertEquals("CL0 class", FileCacheLoader.class.getName(), iclc.getClassName());
      assertEquals("CL0 async", false, iclc.isAsync());
      assertEquals("CL0 fetch", true, iclc.isFetchPersistentState());
      assertEquals("CL0 ignore", true, iclc.isIgnoreModifications());
View Full Code Here


      return cfg;
   }

   private CacheLoaderConfig buildCacheLoaderConfig() throws Exception
   {
      CacheLoaderConfig clc = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(DummySharedInMemoryCacheLoader.class.getName());
      clc.addIndividualCacheLoaderConfig(iclc);
      clc.setPassivation(true);
      return clc;
   }
View Full Code Here

            "               cache.jdbc.table.create=true\n" +
            "               cache.jdbc.table.drop=true\n" +
            "            </properties>\n" +
            "         </loader>\n" +
            "      </loaders>";
      CacheLoaderConfig config = getCacheLoaderConfig(xmlStr);
      assert !config.isPassivation();
      assert !config.isShared();
      assert config.getPreload().equals("/");
      assert config.getFirstCacheLoaderConfig().getClassName().equals("org.jboss.cache.loader.JDBCCacheLoader");
      assert config.getFirstCacheLoaderConfig().isAsync();
      assert !config.getFirstCacheLoaderConfig().isFetchPersistentState();
      assert !config.getFirstCacheLoaderConfig().isIgnoreModifications();
      assert !config.getFirstCacheLoaderConfig().isPurgeOnStartup();
   }
View Full Code Here

            "         <preload/>\n" +
            "         <loader class=\"org.jboss.cache.loader.JDBCCacheLoader\">" +
            "             <singletonStore/>\n" +
            "          </loader>"+
            "      </loaders>";
      CacheLoaderConfig config = getCacheLoaderConfig(xmlStr);
      assert config.getPreload().equals("/") : "the default value for preload is root";
      assert !config.getFirstCacheLoaderConfig().isAsync() : "by default CL are sync";
      assert !config.isShared() : "by default the cl are not sared";
      assert !config.getFirstCacheLoaderConfig().isIgnoreModifications();
      assert !config.getFirstCacheLoaderConfig().isPurgeOnStartup();
      assert !config.getFirstCacheLoaderConfig().getSingletonStoreConfig().isSingletonStoreEnabled();
      assert config.getFirstCacheLoaderConfig().getSingletonStoreConfig().getSingletonStoreClass().equals("org.jboss.cache.loader.SingletonStoreCacheLoader");
      assert config.getFirstCacheLoaderConfig().getSingletonStoreConfig().getSingletonStoreClass().equals("org.jboss.cache.loader.SingletonStoreCacheLoader");
   }
View Full Code Here

            "         </preload>\n" +
            "         <loader class=\"org.jboss.cache.loader.JDBCCacheLoader\" async=\"true\" fetchPersistentState=\"false\"\n" +
            "                      ignoreModifications=\"false\" purgeOnStartup=\"false\">\n" +
            "         </loader>" +
            "</loaders>";
      CacheLoaderConfig config = getCacheLoaderConfig(xmlStr);
      assert config.getPreload().equals("/,/a,/a/b");
      assert config.getFirstCacheLoaderConfig().getSingletonStoreConfig() == null;
   }
View Full Code Here

            "      <loader class=\"org.jboss.cache.loader.bdbje.BdbjeCacheLoader\" async=\"true\" fetchPersistentState=\"true\"\n" +
            "                   ignoreModifications=\"true\" purgeOnStartup=\"true\"/>\n" +
            "      <loader class=\"org.jboss.cache.loader.FileCacheLoader\" async=\"true\" fetchPersistentState=\"true\"\n" +
            "                   ignoreModifications=\"true\" purgeOnStartup=\"true\"/>\n" +
            "   </loaders>";
      CacheLoaderConfig clConfig = getCacheLoaderConfig(xml);
      List<CacheLoaderConfig.IndividualCacheLoaderConfig> indClConfigs = clConfig.getIndividualCacheLoaderConfigs();
      assert indClConfigs.size() == 3;
      assert indClConfigs.get(0).getClassName().equals("org.jboss.cache.loader.JDBCCacheLoader");
      assert indClConfigs.get(1).getClassName().equals("org.jboss.cache.loader.bdbje.BdbjeCacheLoader");
      assert indClConfigs.get(2).getClassName().equals("org.jboss.cache.loader.FileCacheLoader");
View Full Code Here

            "               pushStateWhenCoordinatorTimeout=cus\n" +
            "            </properties>\n" +
            "         </singletonStore>\n" +
            "      </loader>\n" +
            "   </loaders>";
      CacheLoaderConfig clc = getCacheLoaderConfig(xml);
      CacheLoaderConfig.IndividualCacheLoaderConfig icl = clc.getFirstCacheLoaderConfig();
      CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig singletonStoreConfig = icl.getSingletonStoreConfig();
      assert singletonStoreConfig != null;
      assert !singletonStoreConfig.isSingletonStoreEnabled();
      assert singletonStoreConfig.getSingletonStoreClass().equals("org.jboss.cache.loader.SingletonStoreCacheLoader");
      assert singletonStoreConfig.getProperties().size() == 2;
View Full Code Here

      loader = cache.getCacheLoaderManager().getCacheLoader();
   }

   protected void configureCacheLoader() throws Exception
   {
      CacheLoaderConfig clc = new CacheLoaderConfig();
      clc.setPassivation(true);
      clc.setShared(false);
      clc.setPreload("/");

      CacheLoaderConfig.IndividualCacheLoaderConfig dummyConfig = new CacheLoaderConfig.IndividualCacheLoaderConfig();
      dummyConfig.setAsync(false);
      dummyConfig.setFetchPersistentState(true);
      dummyConfig.setIgnoreModifications(false);
      dummyConfig.setClassName(DummyInMemoryCacheLoader.class.getName());
      clc.addIndividualCacheLoaderConfig(dummyConfig);
      cache.getConfiguration().setCacheLoaderConfig(clc);
   }
View Full Code Here

   protected CacheSPI createCacheWithCacheLoader(boolean useDataGravitation, boolean removeOnFind, boolean passivation, boolean fetchPersistent, boolean start) throws Exception
   {
      CacheSPI cache = createCache(1, null, useDataGravitation, removeOnFind, false);

      CacheLoaderConfig config = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
      iclc.setFetchPersistentState(fetchPersistent);
      config.addIndividualCacheLoaderConfig(iclc);
      config.setShared(false);
      config.setPassivation(passivation);
      cache.getConfiguration().setCacheLoaderConfig(config);
      if (start)
      {
         cache.start();
      }
View Full Code Here

      return new ActiveStatusModifier(mscl);
   }

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

TOP

Related Classes of org.jboss.cache.config.CacheLoaderConfig

Copyright © 2018 www.massapicom. 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.