Package org.jboss.cache.config

Examples of org.jboss.cache.config.Configuration


   private Fqn fqn = Fqn.fromString("/test");

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.LOCAL);
      c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      c.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
      if (optLocking)
         c.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache = new UnitTestCacheFactory<Object, Object>().createCache(c, getClass());
      tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      eventLog.events.clear();
      cache.addCacheListener(eventLog);
   }
View Full Code Here


   }


   protected CacheSPI<Object, Object> createUnstartedCache(boolean optimistic) throws Exception
   {
      Configuration c = new Configuration();
      //c.setClusterName("MyCluster");
      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      if (optimistic) c.setNodeLockingScheme("OPTIMISTIC");
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");

      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
      toClean.add(cache);
      return cache;
   }
View Full Code Here

   private CacheSPI<Object, Object> cache2;


   protected void createCaches() throws Throwable
   {
      Configuration c = new Configuration();
      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_ASYNC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      TestingUtil.blockUntilViewReceived(cache1, 2, 10000);
      registerCaches(cache1, cache2);
   }
View Full Code Here

   }

   public void testSingleLoaderNoPurge() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
      Configuration c = cache.getConfiguration();

      String s = "bin=" + getClass().getName();
      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummySharedInMemoryCacheLoader.class.getName(),
            s, false, false, false, false, false));
      cache.start();

      cache.put(fqn, key, value);
View Full Code Here

   }

   public void testSingleLoaderPurge() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(false, getClass());
      Configuration c = cache.getConfiguration();
      String s = "bin=" + getClass().getName();
      c.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummySharedInMemoryCacheLoader.class.getName(),
            s, false, false, false, true, false));
      cache.start();

      cache.put(fqn, key, value);
View Full Code Here

                  "                <properties>bin=" + getClass()+ "bin2</properties>\n" +
                  "         </loader>" +
                  "      </loaders>";
      LoadersElementParser parser = new LoadersElementParser();
      CacheLoaderConfig cacheLoaderConfig = parser.parseLoadersElement(XmlConfigHelper.stringToElementInCoreNS(xml));
      Configuration c = cache.getConfiguration();
      c.setCacheLoaderConfig(cacheLoaderConfig);
      cache.start();

      cache.put(fqn, key, value);

      CacheLoader loader[] = ((ChainingCacheLoader) cache.getCacheLoaderManager().getCacheLoader()).getCacheLoaders().toArray(new CacheLoader[]{});
View Full Code Here

@Test( groups = "functional", testName = "invalidation.OptSyncInvalidationTest")
public class OptSyncInvalidationTest extends AbstractMultipleCachesSyncInvalidationTest
{
   protected void createCaches() throws Throwable
   {
      Configuration c = new Configuration();
      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      c.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      TestingUtil.blockUntilViewReceived(cache1, 2, 10000);
      registerCaches(cache1, cache2);

   }
View Full Code Here

   private Fqn fqn = Fqn.fromString("/one/two/three");


   protected void createCaches() throws Throwable
   {
      Configuration c1 = new Configuration();
      c1.setCacheMode("repl_sync");
      c1.setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      c1.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
      c1.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummyInMemoryCacheLoader.class.getName(),
            "", false, false, false, false, false));
     
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c1, false, getClass());
      cache1.create();
      cache1.start();

      Configuration c2 = new Configuration();
      c2.setCacheMode("repl_sync");
      c2.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
      c2.setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      c2.setCacheLoaderConfig(UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummyInMemoryCacheLoader.class.getName(),
            "", false, false, false, false, false));
      c2.setLockAcquisitionTimeout(2000);
      // cache2.setReplQueueInterval(3000);

      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c2, false, getClass());
      cache2.create();
      cache2.start();
View Full Code Here

      return new SelectedClassnameClassLoader(includesClasses, excludesClasses, cl);
   }

   private Cache<Object, Object> createCache()
   {
      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      Cache<Object, Object> cache = new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
      return cache;
   }
View Full Code Here

   private CacheSPI<Object, Object> cache1;
   private CacheSPI<Object, Object> cache2;
  
   protected void createCaches() throws Throwable
   {
      Configuration c = new Configuration();
      c.setStateRetrievalTimeout(3000);
      c.setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      c.setCacheLoaderConfig(CacheLoaderInvalidationTest.getCacheLoaderConfig(getClass()));
      cache1 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, true, getClass());
      cache2 = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), true, getClass());
      registerCaches(cache1, cache2);
   }
View Full Code Here

TOP

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

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.