Package org.jboss.cache

Examples of org.jboss.cache.DefaultCacheFactory


   private Option cacheModeLocal;

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache1 = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      Configuration c = cache1.getConfiguration();
      c.setCacheMode("REPL_SYNC");
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");

      cache2 = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      c = cache2.getConfiguration();
      c.setCacheMode("REPL_SYNC");
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");

      cacheModeLocal = new Option();
View Full Code Here


      c.setCacheMode(Configuration.CacheMode.LOCAL);
      c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      if (optLocking)
         c.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache = new DefaultCacheFactory().createCache(c);
      tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      eventLog.events.clear();
      cache.addCacheListener(eventLog);
   }
View Full Code Here

      return newCache();
   }

   protected Cache<String, String> newCache()
   {
      CacheFactory<String, String> f = new DefaultCacheFactory();
      Cache<String, String> cache = f.createCache(false);
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      optimisticConfiguration(cache.getConfiguration());
      cache.start();
      return cache;
   }
View Full Code Here

   {
      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.LOCAL);
      c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      c.setCacheLoaderConfig(getCacheLoaderConfig());
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(c);

      cache.start();
      loader = cache.getCacheLoaderManager().getCacheLoader();
   }
View Full Code Here

   public void testInjectConfigFilePath() throws Exception
   {
      createTcpCacheServer();
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory().createCache(conf);
      cache_server.setCache(cacheSPI);
      startTcpCacheServer();
      createCacheAndLoader();
      cacheCheck();
      usabilityCheck();
View Full Code Here

   public void testInjectCache() throws Exception
   {
      createTcpCacheServer();
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory().createCache(conf);
      cache_server.setCache(cacheSPI);
      startTcpCacheServer();
      createCacheAndLoader();
      cacheCheck();
      usabilityCheck();
View Full Code Here

   public void testInjectCacheJmxWrapper() throws Exception
   {
      createTcpCacheServer();
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      CacheSPI cacheSPI = (CacheSPI) new DefaultCacheFactory().createCache(conf);
      CacheJmxWrapper wrapper = new CacheJmxWrapper<Object, Object>(cacheSPI);
      wrapper.start();
      cache_server.setCacheJmxWrapper(wrapper);
      startTcpCacheServer();
      createCacheAndLoader();
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      if (cache != null)
         tearDown();
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI) instance.createCache(false);
      // very short acquisition timeout
      cache.getConfiguration().setLockAcquisitionTimeout(100);
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.start();
View Full Code Here

   private static final Log log = LogFactory.getLog(ConcurrentNotificationTest.class);

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = instance.createCache();
      listener = new Listener();
      cache.addCacheListener(listener);
   }
View Full Code Here

      if (loader != null) loader.wipe();
   }

   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

TOP

Related Classes of org.jboss.cache.DefaultCacheFactory

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.