Package org.jboss.cache.config.Configuration

Examples of org.jboss.cache.config.Configuration.CacheMode


   public void setClusteredCache(Cache<Serializable, Serializable> cache)
   {
      this.cache = cache;
      if (this.cache != null)
      {       
        CacheMode cm = cache.getConfiguration().getCacheMode();
        if (CacheMode.REPL_ASYNC == cm)
        {
           this.replAsync = true;
        }
        else if (CacheMode.REPL_SYNC == cm)
View Full Code Here


      createAlternates(fieldSessionConfig, configurationRegistry.getConfiguration(fieldSessionConfig));     
   }

   private void createAlternates(String stdName, Configuration std) throws Exception
   {
      CacheMode altCacheMode = (std.getCacheMode() == CacheMode.REPL_ASYNC) ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
      String altCacheModeTag = (altCacheMode == CacheMode.REPL_ASYNC ? "async" : "sync");
      boolean brEnabled = !std.getBuddyReplicationConfig().isEnabled();
      String altBrTag = (brEnabled ? "br-enabled" : "br-disabled");
     
      String altModeName = altCacheModeTag + "-" + stdName;
View Full Code Here

      assertNull("Inactivation should have cleared region", cache1.get(fqn, "name"));
   }

   protected CacheSPI<Object, Object> createCache() throws Exception
   {
      CacheMode mode = CacheMode.REPL_SYNC;
      Configuration c = UnitTestConfigurationFactory.createConfiguration(mode);
      CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
      cache.getConfiguration().setUseRegionBasedMarshalling(true);
      cache.getConfiguration().setInactiveOnStartup(true);
      cache.getConfiguration().setBuddyReplicationConfig(getBuddyConfig());
View Full Code Here

         TestingUtil.sleepThread(10);
      }

      // sleep a bit more to ensure the cache2 thread completes
      TestingUtil.sleepThread(5);
      CacheMode mode = cache2.getConfiguration().getCacheMode();
      boolean expectNull = (removeTest || mode == CacheMode.INVALIDATION_ASYNC || mode == CacheMode.INVALIDATION_SYNC);
      assertEquals("Cache2 state incorrect!", expectNull ? null : VALUE2, cache2.get(FQNA, KEY));
   }
View Full Code Here

      assertEquals("Cache1 state incorrect", removeTest ? null : VALUE2, cache1.get(FQNA, KEY));

      // sleep a bit more to ensure the cache2 thread completes
      TestingUtil.sleepThread(500);

      CacheMode mode = cache2.getConfiguration().getCacheMode();
      boolean expectNull = (removeTest || mode == CacheMode.INVALIDATION_ASYNC || mode == CacheMode.INVALIDATION_SYNC);
      assertEquals("Cache2 state incorrect", expectNull ? null : VALUE2, cache2.get(FQNA, KEY));
   }
View Full Code Here

   public void setClusteredCache(Cache<Serializable, Serializable> cache)
   {
      this.cache = cache;
      if (this.cache != null)
      {       
        CacheMode cm = cache.getConfiguration().getCacheMode();
        if (CacheMode.REPL_ASYNC == cm)
        {
           this.replAsync = true;
        }
        else if (CacheMode.REPL_SYNC == cm)
View Full Code Here

   private void internalSetClusteredCache(Cache<Serializable, Serializable> cache)
   {
      this.cache = cache;
      if (this.cache != null)
      {       
        CacheMode cm = cache.getConfiguration().getCacheMode();
        if (CacheMode.REPL_ASYNC == cm)
        {
           this.replAsync = true;
        }
        else if (CacheMode.REPL_SYNC == cm)
View Full Code Here

   protected void injectDependencies(TransactionTable txTable, CacheLoaderManager clm, Configuration configuration,
                                     DataContainer dataContainer, LockManager lockManager, Notifier notifier)
   {
      this.txTable = txTable;
      this.clm = clm;
      CacheMode mode = configuration.getCacheMode();
      usingVersionedInvalidation = configuration.getNodeLockingScheme().isVersionedScheme() && mode.isInvalidation();
      this.dataContainer = dataContainer;
      this.lockManager = lockManager;
      this.notifier = notifier;
   }
View Full Code Here

      if (caches.get(cacheID) != null)
      {
         throw new IllegalStateException(cacheID + " already created");
      }

      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");
View Full Code Here

   @Override
   public void setCache(CacheSPI cache)
   {
      super.setCache(cache);
      CacheMode mode = cache.getConfiguration().getCacheMode();
      useTombstones = (mode == CacheMode.INVALIDATION_ASYNC) || (mode == CacheMode.INVALIDATION_SYNC);
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.Configuration.CacheMode

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.