Package org.jboss.cache

Examples of org.jboss.cache.DefaultCacheFactory


   private Fqn child = Fqn.fromString("/parent/child");

   @BeforeMethod
   public void setUp()
   {
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache.start();
      cache.put(parent, "k", "v");
      cache.put(child, "k", "v");
View Full Code Here


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

      TestingUtil.killCaches(c);
   }

   public void testDefaultInterceptorStack()
   {
      c = (CacheSPI) new DefaultCacheFactory().createCache();

      assert TestingUtil.findInterceptor(c, MarshalledValueInterceptor.class) == null;

      TestingUtil.killCaches(c);

      c = (CacheSPI) new DefaultCacheFactory().createCache(false);
      c.getConfiguration().setUseLazyDeserialization(true);
      c.start();

      assert TestingUtil.findInterceptor(c, MarshalledValueInterceptor.class) != null;
   }
View Full Code Here

   public void testEnabledInterceptorStack()
   {
      Configuration cfg = new Configuration();
      cfg.setUseLazyDeserialization(true);
      c = (CacheSPI) new DefaultCacheFactory().createCache(cfg);

      System.out.println(CachePrinter.printCacheInterceptors(c));
      assert TestingUtil.findInterceptor(c, MarshalledValueInterceptor.class) != null;
   }
View Full Code Here

   public void testDisabledInterceptorStack()
   {
      Configuration cfg = new Configuration();
      cfg.setUseLazyDeserialization(false);
      c = (CacheSPI) new DefaultCacheFactory().createCache(cfg);

      System.out.println(CachePrinter.printCacheInterceptors(c));
      assert TestingUtil.findInterceptor(c, MarshalledValueInterceptor.class) == null;
   }
View Full Code Here

      regionConfigs.add(buildEvictionRegionConfig("/test"));
      regionConfigs.add(UnitTestCacheConfigurationFactory.buildLruEvictionRegionConfig("/lru", 10000,1));
      evConfig.setEvictionRegionConfigs(regionConfigs);
      config.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache_ = (CacheSPI)new DefaultCacheFactory().createCache(config);

      String dfltRootStr = "/a/";
      String testRootStr = "/test/";
      String lruRootStr = "/lru/";
     
View Full Code Here

{
   public void testPessLocking() throws Exception
   {
      Configuration c = new Configuration();
      c.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
      Cache cache = new DefaultCacheFactory().createCache(c);

      assertInterceptorsHaveSameCache((CacheSPI) cache);

      cache.stop();
   }
View Full Code Here

   public void testOptLocking() throws Exception
   {
      Configuration c = new Configuration();
      c.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
      Cache cache = new DefaultCacheFactory().createCache(c);

      assertInterceptorsHaveSameCache((CacheSPI) cache);

      cache.stop();
   }
View Full Code Here

   {
      txManager = new DummyTransactionManagerLookup().getTransactionManager();
      Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      config.setNodeLockingOptimistic(true);
      config.setEvictionConfig(buildEvictionConfig());
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(config);
   }
View Full Code Here

      }
   }

   public void testSingleLoaderNoPurge() throws Exception
   {
      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(false);
      Configuration c = cache.getConfiguration();

      c.setCacheLoaderConfig(getSingleCacheLoaderConfig("", DummySharedInMemoryCacheLoader.class.getName(), "", false, false, false));
      cache.start();
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.