Package org.jboss.cache

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


      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache_ = (CacheSPI<String, String>) instance.createCache(getCfg(), false);
      cache_.getConfiguration().setUseRegionBasedMarshalling(true);
      cache_.start();

      cache1_ = (CacheSPI<String, String>) instance.createCache(getCfg(), false);
      cache1_.getConfiguration().setUseRegionBasedMarshalling(true);

      cache1_.start();
      cache1_.getNotifier().addCacheListener(listener_);
      listener_.resetCounter();
View Full Code Here


   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      log.debug("");
      CacheFactory<String, String> instance = new DefaultCacheFactory();
      cache = (CacheSPI<String, String>) instance.createCache(false);
      cache.getConfiguration().setCacheMode("local");
      configureEviction();
      configureCacheLoader();
      cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp()
   {
      CacheFactory<String, String> cf = new DefaultCacheFactory();
      cache = cf.createCache(false);
      cache.getConfiguration().setIsolationLevel(isolationLevel);
      cache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      // very short so the tests don't take ages
      cache.getConfiguration().setLockAcquisitionTimeout(250);
      cache.start();
View Full Code Here

   public void setUp() throws Exception
   {
      exception = null;
      CacheFactory<Boolean, Boolean> instance = new DefaultCacheFactory();
      // setup and start the source cache
      srcCache = (CacheSPI<Boolean, Boolean>) instance.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
      srcCache.getConfiguration().setTransactionManagerLookupClass(TransactionSetup.getManagerLookup());
      srcCache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);

      srcCache.getConfiguration().setSyncCommitPhase(true);
      srcCache.getConfiguration().setLockAcquisitionTimeout(LOCK_ACQUISITION_TIMEOUT);
View Full Code Here

      srcCache.getConfiguration().setSyncCommitPhase(true);
      srcCache.getConfiguration().setLockAcquisitionTimeout(LOCK_ACQUISITION_TIMEOUT);
      srcCache.create();
      srcCache.start();
      // setup and start the destination cache
      dstCache = (CacheSPI) instance.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
      dstCache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      dstCache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);

      dstCache.getConfiguration().setSyncCommitPhase(true);
      dstCache.getConfiguration().setLockAcquisitionTimeout(LOCK_ACQUISITION_TIMEOUT);
View Full Code Here

   @BeforeMethod
   public void setUp() throws CloneNotSupportedException
   {
      CacheFactory cf = new DefaultCacheFactory();
      c1 = cf.createCache(false);

      c1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      c1.getConfiguration().setBuddyReplicationConfig(brc);
View Full Code Here

      c1.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_SYNC);
      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      c1.getConfiguration().setBuddyReplicationConfig(brc);

      c2 = cf.createCache(c1.getConfiguration().clone(), false);
      c3 = cf.createCache(c1.getConfiguration().clone(), false);

      c1.start();
      c2.start();
      c3.start();
View Full Code Here

      BuddyReplicationConfig brc = new BuddyReplicationConfig();
      brc.setEnabled(true);
      c1.getConfiguration().setBuddyReplicationConfig(brc);

      c2 = cf.createCache(c1.getConfiguration().clone(), false);
      c3 = cf.createCache(c1.getConfiguration().clone(), false);

      c1.start();
      c2.start();
      c3.start();
View Full Code Here

      Configuration c = new Configuration();
      c.setCacheMode(Configuration.CacheMode.LOCAL);
      c.setCacheLoaderConfig(getCacheLoaderConfig());
      c.setExposeManagementStatistics(true);

      CacheSPI<String, Object> cache = (CacheSPI<String, Object>) instance.createCache(c, false);
      cache.create();
      cache.start();
      return cache;
   }
View Full Code Here

    * @throws Exception
    */
   protected CacheModelDelegate createCacheDelegate() throws Exception
   {
      CacheFactory<String, String> factory = new DefaultCacheFactory();
      Cache<String, String> cache = factory.createCache(configurationFile, false);
      CacheModelDelegate delegate = new JBossCacheModelDelegate();
      delegate.setCacheShellVariable(cache);

      return delegate;
   }
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.