Package org.jboss.cache

Examples of org.jboss.cache.DefaultCacheFactory.createCache()


   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setStateRetrievalTimeout(10000);
      cache.getConfiguration().setClusterName("test");
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
View Full Code Here


   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode("local");
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.start();
      mgr = cache.getTransactionManager();
   }
View Full Code Here

      config.setCacheMode(CacheMode.LOCAL);
      config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      config.setLockAcquisitionTimeout(1000);
      config.setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = instance.createCache(config);
   }

   @AfterMethod(alwaysRun = true)
   public void tearDown() throws Exception
   {
View Full Code Here

   }

   protected Cache<String, String> createCache(Configuration config)
   {
      CacheFactory<String, String> factory = new DefaultCacheFactory();
      cache = factory.createCache(config, false);
      return cache;
   }

   protected Configuration createConfiguration()
   {
View Full Code Here

      writerError = null;
      readerError = null;

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.start();
   }
View Full Code Here

   {
      writerFailed = false;
      writerError = null;

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode("LOCAL");
      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.getConfiguration().setLockAcquisitionTimeout(1000);
      cache.start();
View Full Code Here

   }

   public void testWithoutTransactions() throws Exception
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.getConfiguration().setIsolationLevel(IsolationLevel.NONE);
      cache.start();
      cache.put(FQN, KEY, VALUE);
      cache.put(FQN + "/d", KEY, VALUE);
View Full Code Here

   }

   public void testWithTransactions() throws Exception
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.getConfiguration().setIsolationLevel(IsolationLevel.NONE);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.start();
      tm = startTransaction();
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      // start a single cache instance
      CacheFactory<String, String> cf = new DefaultCacheFactory();
      cache = cf.createCache("META-INF/conf-test/local-tx-service.xml", false);
      cache.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
      cache.start();
      version = cache.getVersion();
      cache.getRoot().addChild(parent);
      cache.getRoot().addChild(child);
View Full Code Here

   {
      this.attributeStore = attributeStore;

      CacheFactory factory = new DefaultCacheFactory();

      this.cache = factory.createCache(cacheConfigurationFile);

      this.cache.start();

   }
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.