Package org.jboss.cache

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


   }

   protected Cache<String, String> newCache()
   {
      CacheFactory<String, String> f = new DefaultCacheFactory();
      Cache<String, String> cache = f.createCache(false);
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
      optimisticConfiguration(cache.getConfiguration());

      // need a cache loader as a shared data source between the 2 instances
      CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
View Full Code Here


   public void setUp()
   {
      Configuration c = new Configuration();
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(c);
      tm = cache.getTransactionManager();
   }

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

   protected Cache<String, String> createModifier()
   {
      if (cache == null)
      {
         CacheFactory<String, String> f = new DefaultCacheFactory();
         cache = f.createCache(false);
         optimisticConfiguration(cache.getConfiguration());
         cache.start();
         return cache;
      }
      return cache;
View Full Code Here

      CacheFactory<Integer, String> factory = new DefaultCacheFactory();
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      conf.setEvictionConfig(buildEvictionConfig());
      conf.setCacheLoaderConfig(buildCacheLoaderConfig());
      conf.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache_ = factory.createCache(conf, true);// read in generic local xml
   }

   private CacheLoaderConfig buildCacheLoaderConfig()
         throws IOException
   {
View Full Code Here

   public void setUp() throws Exception
   {
      if (cache != null)
         tearDown();
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache.start();
   }
View Full Code Here

   private Cache<String, String> createCache()
   {
      Configuration config = new Configuration();
      config.setCacheMode(Configuration.CacheMode.REPL_SYNC);
      CacheFactory<String, String> factory = new DefaultCacheFactory();
      Cache<String, String> cache = factory.createCache(config, false);
      caches.add(cache);

      return cache;
   }
}
View Full Code Here

   {
      Configuration config = new Configuration();
      config.setCacheMode(Configuration.CacheMode.LOCAL);
      config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(config);
      m = cache.getTransactionManager();
   }

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

      // force a tear down if the test runner didn't run one before (happens in IDEA)
      if (cache1 != null || cache2 != null)
         tearDown();

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache1 = (CacheSPI<String, String>) instance.createCache(false);
      cache1.getConfiguration().setClusterName("test");
      cache1.getConfiguration().setStateRetrievalTimeout(1000);
      cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
      cache1.getConfiguration().setCacheMode(cacheMode);
View Full Code Here

      cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
      cache1.getConfiguration().setCacheMode(cacheMode);
      cache1.start();

      cache2 = (CacheSPI<String, String>) instance.createCache(false);
      cache2.getConfiguration().setClusterName("test");
      cache2.getConfiguration().setStateRetrievalTimeout(1000);
      cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache2.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
      cache2.getConfiguration().setCacheMode(cacheMode);
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache_ = (CacheSPI<String, String>) instance.createCache(getCfg(), false);
      cache_.getConfiguration().setUseRegionBasedMarshalling(true);
      cache_.start();

      cache1_ = (CacheSPI<String, String>) instance.createCache(getCfg(), false);
      cache1_.getConfiguration().setUseRegionBasedMarshalling(true);
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.