Package org.jboss.cache

Examples of org.jboss.cache.DefaultCacheFactory


   @BeforeMethod(alwaysRun = true)
   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();
   }
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

   private Option option;

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

      cache.start();
View Full Code Here

            "                        cache.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver\n" +
            "                        cache.jdbc.url=jdbc:derby:jbossdb;create=true\n" +
            "                        cache.jdbc.user=user1\n" +
            "                        cache.jdbc.password=user1";

      cache = new DefaultCacheFactory().createCache(false);
      cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("", JDBCCacheLoader.class.getName(), props, false, false, true, false));
      cache.start();
   }
View Full Code Here

   EvictionListener listener_ = new EvictionListener();

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache_ = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC, true), false);
      cache_.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache_.getConfiguration().setUseRegionBasedMarshalling(true);
      cache_.start();
      cache_.getNotifier().addCacheListener(listener_);
      listener_.resetCounter();

      cache2_ = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
      cache2_.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache2_.getConfiguration().setUseRegionBasedMarshalling(true);
      cache2_.start();

      wakeupIntervalMillis_ = cache_.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds() * 1000;
 
View Full Code Here

                     " TcpCacheServer");
            }
         }
         else if (config != null)
         {
            cache = (CacheSPI) new DefaultCacheFactory().createCache(this.config);
         }
      }

      if (cache == null)
      {
View Full Code Here

      erConfigs.add(createEvictionRegionConfig("/_default_",5000));
      erConfigs.add(createEvictionRegionConfig("/org/jboss/test/data",5));
      evConfig.setEvictionRegionConfigs(erConfigs);
      config.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(config, true);// read in generic local xml
   }
View Full Code Here

      // cache-wide
      EvictionConfig ec = new EvictionConfig();
      ec.setWakeupIntervalSeconds(1);
      ec.setEvictionRegionConfigs(evictionRegionConfigs);

      cache = new DefaultCacheFactory().createCache(false);
      cache.getConfiguration().setEvictionConfig(ec);
   }
View Full Code Here

   }

   void initCaches() throws Exception
   {
      TestingUtil.recursiveFileRemove(tmpDir + cacheLoaderDir);
      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
   }
View Full Code Here

   {
      Configuration conf = new Configuration();
      EvictionConfig econf = new EvictionConfig(ExpirationPolicy.class.getName());
      econf.setWakeupIntervalSeconds(1);
      conf.setEvictionConfig(econf);
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(conf, false);
      cache.start();

      future = System.currentTimeMillis() + 4000;
      past = System.currentTimeMillis() - 2000;
   }
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.