Package org.infinispan.config.Configuration

Examples of org.infinispan.config.Configuration.CacheMode


      boolean isSkipLoader = isSkipLoader(flags);
      if (!isSkipLoader) {
         // if we can't skip the cacheloader, we really want a thread for async.
         return false;
      }
      CacheMode cacheMode = config.getCacheMode();
      if (!cacheMode.isDistributed()) {
         //in these cluster modes we won't RPC for a get, so no need to fork a thread.
         return true;
      } else if (flags != null && (flags.contains(Flag.SKIP_REMOTE_LOOKUP) || flags.contains(Flag.CACHE_MODE_LOCAL))) {
         //with these flags we won't RPC either
         return true;
View Full Code Here


* @since 3.5
*/
public class TimestampTypeOverrides extends TypeOverrides {
   @Override
   public void validateInfinispanConfiguration(Configuration configuration) throws CacheException {
      CacheMode cacheMode = configuration.getCacheMode();
      if (cacheMode.equals(CacheMode.INVALIDATION_ASYNC) || cacheMode.equals(CacheMode.INVALIDATION_SYNC)) {
         throw new CacheException("Timestamp cache cannot be configured with invalidation");
      }
      EvictionStrategy strategy = configuration.getEvictionStrategy();
      if (!strategy.equals(EvictionStrategy.NONE)) {
         throw new CacheException("Timestamp cache cannot be configured with eviction");
View Full Code Here

      {
         if (localMode)
         {
            if (allowLocalChanges == null)
            {
               CacheMode cacheMode = cache.getConfiguration().getCacheMode();
               if (cacheMode != CacheMode.DIST_ASYNC && cacheMode != CacheMode.DIST_SYNC)
               {
                  cache.withFlags(Flag.CACHE_MODE_LOCAL);
               }
            }
View Full Code Here

      boolean isSkipLoader = isSkipLoader(flags);
      if (!isSkipLoader) {
         // if we can't skip the cacheloader, we really want a thread for async.
         return false;
      }
      CacheMode cacheMode = config.getCacheMode();
      if (!cacheMode.isDistributed()) {
         //in these cluster modes we won't RPC for a get, so no need to fork a thread.
         return true;
      } else if (flags != null && (flags.contains(Flag.SKIP_REMOTE_LOOKUP) || flags.contains(Flag.CACHE_MODE_LOCAL))) {
         //with these flags we won't RPC either
         return true;
View Full Code Here

      Configuration configuration = templateCache.getConfiguration().clone();
     
      Integer backups = replConfig.getBackups();
      ReplicationMode replMode = replConfig.getReplicationMode();
     
      CacheMode mode = configuration.getCacheMode();
     
      if (backups != null)
      {
         int value = backups.intValue();
        
         configuration.setNumOwners(value);
        
         if (value == 0)
         {
            mode = CacheMode.LOCAL;
         }
         else
         {
            boolean synchronous = mode.isSynchronous();
            if (value > 0)
            {
               mode = synchronous ? CacheMode.DIST_SYNC : CacheMode.DIST_ASYNC;
            }
            else // Negative backups means total replication
            {
               mode = synchronous ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
            }
         }
      }
     
      if (replMode != null)
      {
         switch (replMode)
         {
            case SYNCHRONOUS:
            {
               mode = mode.toSync();
               break;
            }
            case ASYNCHRONOUS:
            {
               mode = mode.toAsync();
               break;
            }
         }
      }
     
View Full Code Here

      boolean isSkipLoader = isSkipLoader(flags);
      if ( ! isSkipLoader ) {
         // if we can't skip the cacheloader, we really want a thread for async.
         return false;
      }
      CacheMode cacheMode = config.getCacheMode();
      if ( ! cacheMode.isDistributed() ) {
         //in these cluster modes we won't RPC for a get, so no need to fork a thread.
         return true;
      }
      else if (flags != null && (flags.contains(Flag.SKIP_REMOTE_LOOKUP) || flags.contains(Flag.CACHE_MODE_LOCAL))) {
         //with these flags we won't RPC either
View Full Code Here

      Configuration configuration = templateCache.getConfiguration().clone();
     
      Integer backups = replConfig.getBackups();
      ReplicationMode replMode = replConfig.getReplicationMode();
     
      CacheMode mode = configuration.getCacheMode();
     
      if (backups != null)
      {
         int value = backups.intValue();
        
         configuration.setNumOwners(value);
        
         if (value == 0)
         {
            mode = CacheMode.LOCAL;
         }
         else
         {
            boolean synchronous = mode.isSynchronous();
            if (value > 0)
            {
               mode = synchronous ? CacheMode.DIST_SYNC : CacheMode.DIST_ASYNC;
            }
            else // Negative backups means total replication
            {
               mode = synchronous ? CacheMode.REPL_SYNC : CacheMode.REPL_ASYNC;
            }
         }
      }
     
      if (replMode != null)
      {
         switch (replMode)
         {
            case SYNCHRONOUS:
            {
               mode = mode.toSync();
               break;
            }
            case ASYNCHRONOUS:
            {
               mode = mode.toAsync();
               break;
            }
         }
      }
     
View Full Code Here

      boolean isSkipLoader = isSkipLoader(flags);
      if ( ! isSkipLoader ) {
         // if we can't skip the cacheloader, we really want a thread for async.
         return false;
      }
      CacheMode cacheMode = config.getCacheMode();
      if ( ! cacheMode.isDistributed() ) {
         //in these cluster modes we won't RPC for a get, so no need to fork a thread.
         return true;
      }
      else if (flags != null && (flags.contains(Flag.SKIP_REMOTE_LOOKUP) || flags.contains(Flag.CACHE_MODE_LOCAL))) {
         //with these flags we won't RPC either
View Full Code Here

TOP

Related Classes of org.infinispan.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.