Package org.jboss.cache

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


   }

   private void initCaches(Configuration.CacheMode caching_mode)
   {
      CacheFactory<String, ContainerData> instance = new DefaultCacheFactory();
      cache1 = (CacheSPI<String, ContainerData>) instance.createCache(false);
      cache2 = (CacheSPI<String, ContainerData>) instance.createCache(false);
      cache1.getConfiguration().setCacheMode(caching_mode);
      cache2.getConfiguration().setCacheMode(caching_mode);
      cache1.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache2.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
View Full Code Here


   private void initCaches(Configuration.CacheMode caching_mode)
   {
      CacheFactory<String, ContainerData> instance = new DefaultCacheFactory();
      cache1 = (CacheSPI<String, ContainerData>) instance.createCache(false);
      cache2 = (CacheSPI<String, ContainerData>) instance.createCache(false);
      cache1.getConfiguration().setCacheMode(caching_mode);
      cache2.getConfiguration().setCacheMode(caching_mode);
      cache1.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache2.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
View Full Code Here

   @BeforeMethod
   public void setUp() throws Exception
   {
      CacheFactory cf = new DefaultCacheFactory();

      Cache cache = cf.createCache(false);
      cr = TestingUtil.extractComponentRegistry(cache);
      configuration = cache.getConfiguration();
   }

   public void testDefaultFactoryScanning()
View Full Code Here

   private CacheSPI<Object, Object> createCache(String clusterName) throws Exception
   {
      Configuration config = createConfiguration(clusterName);
      CacheFactory<Object, Object> factory = new DefaultCacheFactory();
      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) factory.createCache(config, false);

      cache.create();
      // start the cache after the listener has been registered
      //cache.start();
      return cache;
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
      cache.getConfiguration().setUseRegionBasedMarshalling(true);

      cache.start();
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      CacheFactory<String, String> cf = new DefaultCacheFactory();

      cache1 = (CacheSPI<String, String>) cf.createCache(UnitTestCacheConfigurationFactory.createConfiguration(cacheMode), false);
      cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache1.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
//      cache1.getConfiguration().setSyncCommitPhase(optimistic);
//      cache1.getConfiguration().setSyncRollbackPhase(optimistic);
View Full Code Here

//      cache1.getConfiguration().setSyncRollbackPhase(optimistic);

      cache1.start();
      tm1 = cache1.getConfiguration().getRuntimeConfig().getTransactionManager();

      cache2 = (CacheSPI<String, String>) cf.createCache(UnitTestCacheConfigurationFactory.createConfiguration(cacheMode), false);
      cache2.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache2.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
//      cache2.getConfiguration().setSyncCommitPhase(optimistic);
//      cache2.getConfiguration().setSyncRollbackPhase(optimistic);
View Full Code Here

      // more time to help with debugging
      c.setSyncReplTimeout(60000);

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache1 = instance.createCache(c);
      cache2 = instance.createCache(c.clone());

      eventLog1.events.clear();
      eventLog2.events.clear();
View Full Code Here

      // more time to help with debugging
      c.setSyncReplTimeout(60000);

      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache1 = instance.createCache(c);
      cache2 = instance.createCache(c.clone());

      eventLog1.events.clear();
      eventLog2.events.clear();

      cache1.addCacheListener(eventLog1);
View Full Code Here

      cache1.put(fqnA, data);
      cache1.put(fqnB, data);

      // create cache2
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache2 = instance.createCache(cache1.getConfiguration().clone(), false);
      cache2.create();
      eventLog2.events.clear();
      cache2.addCacheListener(eventLog2);
      cache2.start(); // should initiate a state transfer
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.