Package org.jboss.cache.config.CacheLoaderConfig

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


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

      Configuration c = new Configuration();
      c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      c.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());

      CacheLoaderConfig clc = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
      clc.addIndividualCacheLoaderConfig(iclc);
      clc.setPassivation(true);

      c.setCacheLoaderConfig(clc);
      cache = new UnitTestCacheFactory<Object, Object>().createCache(c, getClass());
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(legacy).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

   {

      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
      //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

      }

      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

      singletonStoreProperties.setProperty("pushStateWhenCoordinator", pushState.toString());
      singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout", pushStateTimeOut.toString());
      singletonStoreConfig.setProperties(singletonStoreProperties);
      singletonStoreConfig.setSingletonStoreEnabled(true);
      // create CacheLoaderConfig
      IndividualCacheLoaderConfig individualCacheLoaderConfig = new IndividualCacheLoaderConfig();
      // set SingletonStoreConfig
      individualCacheLoaderConfig.setSingletonStoreConfig(singletonStoreConfig);
      // set CacheLoader
      individualCacheLoaderConfig.setCacheLoader(indexerCacheLoader);
      // set parameters
      individualCacheLoaderConfig.setFetchPersistentState(false);
      individualCacheLoaderConfig.setAsync(false);
      individualCacheLoaderConfig.setIgnoreModifications(false);
      individualCacheLoaderConfig.setPurgeOnStartup(false);
      // create CacheLoaderConfig
      CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
      cacheLoaderConfig.setShared(false);
      cacheLoaderConfig.setPassivation(false);
      cacheLoaderConfig.addIndividualCacheLoaderConfig(individualCacheLoaderConfig);
View Full Code Here

      }

      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

      }

      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

      singletonStoreProperties.setProperty("pushStateWhenCoordinator", pushState.toString());
      singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout", pushStateTimeOut.toString());
      singletonStoreConfig.setProperties(singletonStoreProperties);
      singletonStoreConfig.setSingletonStoreEnabled(true);
      // create CacheLoaderConfig
      IndividualCacheLoaderConfig individualCacheLoaderConfig = new IndividualCacheLoaderConfig();
      // set SingletonStoreConfig
      individualCacheLoaderConfig.setSingletonStoreConfig(singletonStoreConfig);
      // set CacheLoader
      individualCacheLoaderConfig.setCacheLoader(indexerCacheLoader);
      // set parameters
      individualCacheLoaderConfig.setFetchPersistentState(false);
      individualCacheLoaderConfig.setAsync(false);
      individualCacheLoaderConfig.setIgnoreModifications(false);
      individualCacheLoaderConfig.setPurgeOnStartup(false);
      // create CacheLoaderConfig
      CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
      cacheLoaderConfig.setShared(false);
      cacheLoaderConfig.setPassivation(false);
      cacheLoaderConfig.addIndividualCacheLoaderConfig(individualCacheLoaderConfig);
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.