Examples of CacheLoaderConfig


Examples of org.jboss.cache.config.CacheLoaderConfig

   private Configuration getConfiguration(Properties props) throws Exception
   {
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass(GenericTransactionManagerLookup.class.getName());
      CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "/", JDBCCacheLoader.class.getName(), props, false, true, false, false, false);
      clc.setPassivation(false);
      clc.getFirstCacheLoaderConfig().setPurgeOnStartup(true);
      c.setCacheLoaderConfig(clc);
      c.setCacheMode(CacheMode.REPL_SYNC);
      c.setStateRetrievalTimeout(1000 * 120);//allow 2 minutes for before state transfer timeouts
      return c;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
      CacheLoaderConfig clc = new CacheLoaderConfig();
      CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
      clc.addIndividualCacheLoaderConfig(iclc);
      cache.getConfiguration().setCacheLoaderConfig(clc);
      cache.getConfiguration().setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
      mockCacheLoader = createMock(CacheLoader.class);

      expect(mockCacheLoader.getConfig()).andReturn(null).anyTimes();
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      cache = null;
   }

   protected CacheLoaderConfig getCacheLoaderConfig(boolean ignoreMods1, boolean ignoreMods2) throws Exception
   {
      CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, null, DummyInMemoryCacheLoader.class.getName(), "", false, true, false, false, ignoreMods1);
      CacheLoaderConfig.IndividualCacheLoaderConfig ic = UnitTestConfigurationFactory.buildIndividualCacheLoaderConfig(null, DummyInMemoryCacheLoader.class.getName(), "", false, false, false, ignoreMods2);
      clc.addIndividualCacheLoaderConfig(ic);
      return clc;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      LocalDelegatingCacheLoaderConfig cfg = new LocalDelegatingCacheLoaderConfig();
      cfg.setDelegate(delegating_cache);
      cfg.setAsync(false);
      cfg.setFetchPersistentState(false);
      CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
      cacheLoaderConfig.addIndividualCacheLoaderConfig(cfg);
      cacheLoaderConfig.setPassivation(true);
      cache.getConfiguration().setCacheLoaderConfig(cacheLoaderConfig);
   }
View Full Code Here

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(legacy).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

Examples of org.jboss.cache.config.CacheLoaderConfig

      if (cacheloaderClass != null)
      {
         if (cacheloaderClass.equals("org.jboss.cache.loader.JDBCCacheLoader"))
         {
            Properties prop = UnitTestDatabaseManager.getTestDbProperties();
            CacheLoaderConfig clc = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", "org.jboss.cache.loader.JDBCCacheLoader",
                  prop, false, true, false, false, false);
            clc.getFirstCacheLoaderConfig().setPurgeOnStartup(true);
            c.setCacheLoaderConfig(clc);
         } else if (cacheloaderClass.equals(FileCacheLoader.class.getName()))
         {
            String tmpLocation = getTempLocation(cacheID);
            File file = new File(tmpLocation);
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

            wakeupInterval
      );

      config.setEvictionConfig(ec);

      CacheLoaderConfig clc = new CacheLoaderConfig();
      clc.setPassivation(true);
      clc.setShared(false);
      JDBCCacheLoaderConfig jdbc_clc = new JDBCCacheLoaderConfig();
      jdbc_clc.setProperties(prop);

      clc.setIndividualCacheLoaderConfigs(Collections.<IndividualCacheLoaderConfig>singletonList(jdbc_clc));
      config.setCacheLoaderConfig(clc);

      return cache;
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      LocalDelegatingCacheLoaderConfig cfg = new LocalDelegatingCacheLoaderConfig();
      cfg.setDelegate(delegatingCache);
      cfg.setAsync(false);
      cfg.setFetchPersistentState(false);
      CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
      cacheLoaderConfig.addIndividualCacheLoaderConfig(cfg);
      cache.getConfiguration().setCacheLoaderConfig(cacheLoaderConfig);
   }
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

   public void testBlockingProblem() throws Exception
   {

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

      long begin = System.currentTimeMillis();
View Full Code Here

Examples of org.jboss.cache.config.CacheLoaderConfig

      {
         properties =
               "cache.s3.accessKeyId=" + accessKey + "\n" +
                     "cache.s3.secretAccessKey=" + System.getProperty("secretKey") + "\n";
      }
      CacheLoaderConfig config = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", "org.jboss.cache.loader.s3.S3CacheLoader",
            properties, false, true, false, false, false);
      Properties p = config.getFirstCacheLoaderConfig().getProperties();
      assertNotNull(p.get("cache.s3.accessKeyId"));
      assertNotNull(p.get("cache.s3.secretAccessKey"));
      cache.getConfiguration().setCacheLoaderConfig(config);
   }
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.