Package org.jboss.cache

Examples of org.jboss.cache.DefaultCacheFactory


   private RegionManager regionManager;

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache.getConfiguration().setCacheMode("LOCAL");
      EvictionConfig ec = new EvictionConfig();
View Full Code Here


   private CacheLoader mockCacheLoader;

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      CacheLoaderConfig clc = new CacheLoaderConfig();
      CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
      clc.addIndividualCacheLoaderConfig(iclc);
      cache.getConfiguration().setCacheLoaderConfig(clc);
      mockCacheLoader = createMock(CacheLoader.class);
View Full Code Here

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

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache = new DefaultCacheFactory().createCache(false);

      cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
      cache.getConfiguration().setUseRegionBasedMarshalling(true);
   }
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      newImpl = getNewCacheLoader();
      oldImpl = getOldLoader();
      cache = (CacheSPI) new DefaultCacheFactory().createCache();
      cache2 = (CacheSPI) new DefaultCacheFactory().createCache();
      newImpl.setCache(cache);//this is needed for marshaller
      oldImpl.setCache(cache2);
      oldImpl.start();
      oldImpl.remove(Fqn.ROOT);
   }
View Full Code Here

      }

      CacheMode mode = sync ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
      Configuration c = UnitTestCacheConfigurationFactory.createConfiguration(mode);

      CacheSPI<?, ?> cache = (CacheSPI<?, ?>) new DefaultCacheFactory().createCache(c, false);

      cache.getConfiguration().setClusterName("TestCluster");
      if (useMarshalling)
      {
         cache.getConfiguration().setUseRegionBasedMarshalling(true);
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      if (cache != null) tearDown();
      cache = (CacheSPI) new DefaultCacheFactory().createCache(false);
      cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig("", DummyCountingCacheLoader.class.getName(), "", false, false, false));
      cache.start();
      dummyLoader = (DummyCountingCacheLoader) cache.getCacheLoaderManager().getCacheLoader();
   }
View Full Code Here

   private Method invokeMethod;

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache();
      cache.put(fqn, key, value);
      rcid = TestingUtil.getRemoteDelegate(cache);
      invokeMethod = cache.getClass().getSuperclass().getDeclaredMethod("invoke", MethodCall.class);
   }
View Full Code Here

   @SuppressWarnings("deprecation")
   public void testBlockingProblem() throws Exception
   {

      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      //setCacheLoader(new TestSlowCacheLoader());
      CacheLoaderConfig clc = new CacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = new IndividualCacheLoaderConfig();
      //iclc.setClassName(TestSlowCacheLoader.class.getName());
      iclc.setCacheLoader(new TestSlowCacheLoader());
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      Configuration cacheConfig = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      cacheConfig.setCacheMode(Configuration.CacheMode.LOCAL);
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(cacheConfig, false);
      cache.getConfiguration().getEvictionConfig().setWakeupIntervalSeconds(1);
      createNewRegion();
      cache.start();
   }
View Full Code Here

   {

      Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      config.setCacheMode(Configuration.CacheMode.LOCAL);
      config.setNodeLockingOptimistic(true);
      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(config, true);

      cache.put(Fqn.fromString("/a/b"), "key", "value");
      TransactionManager txManager = cache.getTransactionManager();
      txManager.begin();
      cache.getRoot().getChild(Fqn.fromString("/a/b")).setResident(true);
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.