Package org.jboss.cache.config

Examples of org.jboss.cache.config.CacheLoaderConfig


     
   }

   protected void configureCache() throws Exception
   {
      CacheLoaderConfig loaderConfig = buildSingleCacheLoaderConfig(true, null, "org.jboss.cache.loader.JDBCCacheLoader",
            getJDBCProps(), false, false, false, false, false);
      CacheSPI<Object, Object> cache = cacheTL.get();
      cache.getConfiguration().setCacheLoaderConfig(loaderConfig);
   }
View Full Code Here


            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

   public void testCacheLoader()
   {
      assert c.getCacheLoaderManager() != null;
      assert c.getCacheLoaderManager().getCacheLoader() == null;

      CacheLoaderConfig clc = new CacheLoaderConfig();
      CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
      iclc.setCacheLoader(new DummyInMemoryCacheLoader());
      clc.addIndividualCacheLoaderConfig(iclc);
      c.getConfiguration().setCacheLoaderConfig(clc);

      c.start();
      assert c.getCacheLoaderManager() != null;
      assert c.getCacheLoaderManager().getCacheLoader() instanceof DummyInMemoryCacheLoader;
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

                  + prop.getProperty("cache.jdbc.password") + "\n" + "cache.jdbc.node.type="
                  + prop.getProperty("cache.jdbc.node.type") + "\n" + "cache.jdbc.sql-concat="                 
                  + prop.getProperty("cache.jdbc.sql-concat") + "\n" + "cache.jdbc.table.name="
                  + prop.getProperty("cache.jdbc.table.name");
           
            CacheLoaderConfig clc = getSingleCacheLoaderConfig("", "org.jboss.cache.loader.JDBCCacheLoader", props, false, true, false);
            clc.getFirstCacheLoaderConfig().setPurgeOnStartup(true);
            c.setCacheLoaderConfig(clc);
         }
         else
         {
View Full Code Here

      assertInterceptorLinkage(list);
   }

   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

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

   public void testBlockingProblem() throws Exception
   {

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

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

      assert !syncConfig.getExposeManagementStatistics();
   }

   public void testCacheLoaderConfiguration()
   {
      CacheLoaderConfig clc = syncConfig.getCacheLoaderConfig();
      assert null != clc;
      assert clc.isPassivation();
      assert clc.isShared();
      assert "/a/b/c,/f/r/s".equals(clc.getPreload());
      CacheLoaderConfig.IndividualCacheLoaderConfig first = clc.getFirstCacheLoaderConfig();
      assert "org.jboss.cache.loader.JDBCCacheLoader".equals(first.getClassName());
      assert first.isAsync();
      assert first.isFetchPersistentState();
      assert first.isIgnoreModifications();
      assert first.isPurgeOnStartup();
View Full Code Here

      cache = new UnitTestCacheFactory<Object, Object>().createCache(false);
      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);

      CacheLoaderConfig clc = new CacheLoaderConfig();
      CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
      iclc.setProperties("debug=true");
      iclc.setClassName(DummySharedInMemoryCacheLoader.class.getName());
      clc.addIndividualCacheLoaderConfig(iclc);

      cache.getConfiguration().setCacheLoaderConfig(clc);

      cache.start();
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.