Package org.jboss.cache

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


   public void setUp() throws Exception
   {
      // need 2 caches to test viewChange notifications

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache1 = instance.createCache(false);
      cache2 = instance.createCache(false);
      cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      cache1.getConfiguration().setSyncCommitPhase(true);
      cache2.getConfiguration().setSyncCommitPhase(true);
View Full Code Here


   {
      // need 2 caches to test viewChange notifications

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache1 = instance.createCache(false);
      cache2 = instance.createCache(false);
      cache1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      cache2.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      cache1.getConfiguration().setSyncCommitPhase(true);
      cache2.getConfiguration().setSyncCommitPhase(true);
      cache1.getConfiguration().setSyncRollbackPhase(true);
View Full Code Here

   }

   public void testWithTransactionsRepeatableRead() 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.REPEATABLE_READ);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.start();
      tm = startTransaction();
View Full Code Here

      config.setCacheMode(CacheMode.LOCAL);
      config.setIsolationLevel(IsolationLevel.READ_COMMITTED);
      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

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      CacheFactory<Object, Integer> instance = new DefaultCacheFactory();
      cache = (CacheSPI<Object, Integer>) instance.createCache(conf, false);
      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      cache.create();
      cache.start();
   }
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();
      events.clear();
   }
View Full Code Here

   }

   private void initCaches()
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      Object listener = new TestCacheListener();
      cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
      cache.start();
      cache.getNotifier().addCacheListener(listener);
View Full Code Here

   }

   private void initCaches()
   {
      CacheFactory<Integer, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
      cache.start();
   }
View Full Code Here

   public void setUp() throws Exception
   {
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.AsyncRollbackTransactionManagerLookup");
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(c);
      tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      tm.setTransactionTimeout(txTimeout);
   }

   @AfterMethod(alwaysRun = true)
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.create();
      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.