Package org.jboss.cache.config.CacheLoaderConfig

Examples of org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig


      ControllerCacheLoader ccl = new ControllerCacheLoader(currentCL);

      List<IndividualCacheLoaderConfig> newConfig = new ArrayList<IndividualCacheLoaderConfig>(1);
      // create CacheLoaderConfig
      IndividualCacheLoaderConfig cclConfig = new IndividualCacheLoaderConfig();
      // set CacheLoader
      cclConfig.setCacheLoader(ccl);
      // set parameters
      cclConfig.setFetchPersistentState(clm.isFetchPersistentState());
      cclConfig.setAsync(false);
      cclConfig.setIgnoreModifications(false);
      CacheLoaderConfig.IndividualCacheLoaderConfig first = config.getFirstCacheLoaderConfig();
      cclConfig.setPurgeOnStartup(first != null && first.isPurgeOnStartup());
      newConfig.add(cclConfig);
      config.setIndividualCacheLoaderConfigs(newConfig);

      if (LOG.isInfoEnabled())
      {
View Full Code Here


   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

      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());
      assertEquals("CL0 purge", true, iclc.isPurgeOnStartup());
      assertEquals("CL0 singleton", true, iclc.getSingletonStoreConfig().isSingletonStoreEnabled());
      assertEquals("CL0 singleton class", SingletonStoreCacheLoader.class.getName(), iclc.getSingletonStoreConfig().getSingletonStoreClass());
      iclc = iclcs.get(1);
      assertEquals("CL1 class", JdbmCacheLoader.class.getName(), iclc.getClassName());
      assertEquals("CL1 async", true, iclc.isAsync());
      assertEquals("CL1 fetch", false, iclc.isFetchPersistentState());
      assertEquals("CL1 ignore", false, iclc.isIgnoreModifications());
      assertEquals("CL1 purge", false, iclc.isPurgeOnStartup());
      assertEquals("CL1 singleton", false, iclc.getSingletonStoreConfig().isSingletonStoreEnabled());
      assertEquals("CL1 singleton class", SingletonStoreCacheLoader.class.getName(), iclc.getSingletonStoreConfig().getSingletonStoreClass());

      assertEquals("EvictionPolicyConfig", getEvictionPolicyConfig().toString(), wrapper.getEvictionPolicyConfig().toString());
      EvictionConfig ec = c.getEvictionConfig();
      assertEquals("EC queue size", 1000, ec.getDefaultEvictionRegionConfig().getEventQueueSize());
      assertEquals("EC wakeup", 5000, ec.getWakeupInterval());
View Full Code Here

   }

   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

   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)
View Full Code Here

   public static CacheLoaderConfig buildSingleCacheLoaderConfig(boolean passivation, String preload, String cacheloaderClass,
                                                                String properties, boolean async, boolean fetchPersistentState,
                                                                boolean shared, boolean purgeOnStartup, boolean ignoreModifications) throws Exception
   {
      CacheLoaderConfig clc = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(cacheloaderClass);
      iclc.setAsync(async);
      iclc.setFetchPersistentState(fetchPersistentState);
      iclc.setPurgeOnStartup(purgeOnStartup);
      iclc.setIgnoreModifications(ignoreModifications);
      iclc.setProperties(properties);
      clc.addIndividualCacheLoaderConfig(iclc);
      clc.setPassivation(passivation);
      clc.setShared(shared);
      clc.setPreload(preload);
      return clc;
View Full Code Here

      EvictionRegionConfig erc = ec.getDefaultEvictionRegionConfig();
      LRUAlgorithmConfig epc = (LRUAlgorithmConfig) erc.getEvictionAlgorithmConfig();
      assertEquals(1000, epc.getMaxNodes());

      CacheLoaderConfig clc = cfg.getCacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = clc.getFirstCacheLoaderConfig();
      assertEquals(System.getProperty("java.io.tmpdir"), iclc.getProperties().get("location"));

      BuddyReplicationConfig brc = cfg.getBuddyReplicationConfig();
      assertTrue(brc.isEnabled());
      assertEquals("replaced", brc.getBuddyPoolName());
      BuddyLocatorConfig blc = brc.getBuddyLocatorConfig();
View Full Code Here

   }

   protected CacheLoaderConfig getCacheLoaderConfig(boolean pasv, boolean fetchPersistentState) throws Exception
   {
      CacheLoaderConfig clc = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
      iclc.setFetchPersistentState(fetchPersistentState);
      clc.addIndividualCacheLoaderConfig(iclc);
      clc.setPassivation(pasv);
      return clc;
   }
View Full Code Here

   {

      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false);
      //setCacheLoader(new TestSlowCacheLoader());
      CacheLoaderConfig clc = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      //iclc.setClassName(TestSlowCacheLoader.class.getName());
      iclc.setCacheLoader(new TestSlowCacheLoader());
      clc.addIndividualCacheLoaderConfig(iclc);
      cache.getConfiguration().setCacheLoaderConfig(clc);
      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
      cache.start();
View Full Code Here

         Configuration cfg = new Configuration();
         cfg.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
         cfg.setCacheMode(CacheMode.REPL_SYNC);
         cfg.setFetchInMemoryState(true);
         // configure with CL
         IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
         iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
         iclc.setFetchPersistentState(false);
         CacheLoaderConfig clc = new CacheLoaderConfig();
         clc.addIndividualCacheLoaderConfig(iclc);

         cfg.setCacheLoaderConfig(clc);
         cfg.setNodeLockingScheme(nls);
View Full Code Here

TOP

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

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.