Package org.infinispan.loaders.file

Examples of org.infinispan.loaders.file.FileCacheStoreConfig


         .shared(legacy.isCacheLoaderShared());

      for (CacheLoaderConfig clc : legacy.getCacheLoaders()) {
         AbstractLoaderConfigurationBuilder loaderBuilder = null;
         if (clc instanceof FileCacheStoreConfig) {
            FileCacheStoreConfig csc = (FileCacheStoreConfig) clc;
            FileCacheStoreConfigurationBuilder fcsBuilder = builder.loaders().addFileCacheStore();
            fcsBuilder.fetchPersistentState(csc.isFetchPersistentState());
            fcsBuilder.ignoreModifications(csc.isIgnoreModifications());
            fcsBuilder.purgeOnStartup(csc.isPurgeOnStartup());
            fcsBuilder.purgerThreads(csc.getPurgerThreads());
            fcsBuilder.purgeSynchronously(csc.isPurgeSynchronously());
            fcsBuilder.location(csc.getLocation());
            fcsBuilder.fsyncInterval(csc.getFsyncInterval());
            fcsBuilder.fsyncMode(FileCacheStoreConfigurationBuilder.FsyncMode.valueOf(csc.getFsyncMode().name()));
            fcsBuilder.streamBufferSize(csc.getStreamBufferSize());
            loaderBuilder = fcsBuilder;
         } else {
            LoaderConfigurationBuilder tmpLoaderBuilder = builder.loaders().addCacheLoader();
            tmpLoaderBuilder.cacheLoader(Util.<CacheLoader>getInstance(clc.getCacheLoaderClassName(), legacy.getClassLoader()));
            if (clc instanceof CacheStoreConfig) {
               CacheStoreConfig csc = (CacheStoreConfig) clc;
               tmpLoaderBuilder.fetchPersistentState(csc.isFetchPersistentState());
               tmpLoaderBuilder.ignoreModifications(csc.isIgnoreModifications());
               tmpLoaderBuilder.purgeOnStartup(csc.isPurgeOnStartup());
               tmpLoaderBuilder.purgerThreads(csc.getPurgerThreads());
               tmpLoaderBuilder.purgeSynchronously(csc.isPurgeSynchronously());
               loaderBuilder = tmpLoaderBuilder;
            }
            if (clc instanceof AbstractCacheStoreConfig) {
               tmpLoaderBuilder.withProperties(((AbstractCacheLoaderConfig) clc).getProperties());
            }
         }
         if (clc instanceof CacheStoreConfig) {
            CacheStoreConfig csc = (CacheStoreConfig) clc;
            loaderBuilder.async().enabled(csc.getAsyncStoreConfig().isEnabled());
            loaderBuilder.async().flushLockTimeout(csc.getAsyncStoreConfig().getFlushLockTimeout());
            loaderBuilder.async().modificationQueueSize(csc.getAsyncStoreConfig().getModificationQueueSize());
            loaderBuilder.async().shutdownTimeout(csc.getAsyncStoreConfig().getShutdownTimeout());
            loaderBuilder.async().threadPoolSize(csc.getAsyncStoreConfig().getThreadPoolSize());
            loaderBuilder.singletonStore().enabled(csc.getSingletonStoreConfig().isSingletonStoreEnabled());
            loaderBuilder.singletonStore().pushStateTimeout(csc.getSingletonStoreConfig().getPushStateTimeout());
            loaderBuilder.singletonStore().pushStateWhenCoordinator(csc.getSingletonStoreConfig().isPushStateWhenCoordinator());
         }
      }
     
      builder.locking()
         .concurrencyLevel(legacy.getConcurrencyLevel())


               acsc.setCacheLoaderClassName(((LoaderConfiguration) loader).cacheLoader().getClass().getName());
               clc = acsc;
            }
           
         } else if (loader instanceof FileCacheStoreConfiguration) {
            FileCacheStoreConfig fcsc = new FileCacheStoreConfig();
            clc = fcsc;
            String location = loader.properties().getProperty("location");
            if (location != null)
               fcsc.location(location);
         }
         if (clc instanceof CacheStoreConfig) {
            CacheStoreConfig csc = (CacheStoreConfig) clc;
            csc.fetchPersistentState(loader.fetchPersistentState());
            csc.ignoreModifications(loader.ignoreModifications());

               acsc.setCacheLoaderClassName(((LoaderConfiguration) loader).cacheLoader().getClass().getName());
               clc = acsc;
            }
           
         } else if (loader instanceof FileCacheStoreConfiguration) {
            FileCacheStoreConfig fcsc = new FileCacheStoreConfig();
            clc = fcsc;
            String location = loader.properties().getProperty("location");
            if (location != null)
               fcsc.location(location);
         }
         if (clc instanceof CacheStoreConfig) {
            CacheStoreConfig csc = (CacheStoreConfig) clc;
            csc.fetchPersistentState(loader.fetchPersistentState());
            csc.ignoreModifications(loader.ignoreModifications());

         ClusterCacheLoaderConfig cclc = (ClusterCacheLoaderConfig) clc;
         ClusterCacheLoaderConfigurationBuilder cclBuilder = builder.loaders().addClusterCacheLoader();
         cclBuilder.remoteCallTimeout(cclc.getRemoteCallTimeout());
         loaderBuilder = cclBuilder;
      } else if (clc instanceof FileCacheStoreConfig) {
         FileCacheStoreConfig csc = (FileCacheStoreConfig) clc;
         FileCacheStoreConfigurationBuilder fcsBuilder = builder.loaders().addFileCacheStore();

         fcsBuilder.fetchPersistentState(csc.isFetchPersistentState());
         fcsBuilder.ignoreModifications(csc.isIgnoreModifications());
         fcsBuilder.purgeOnStartup(csc.isPurgeOnStartup());
         fcsBuilder.purgerThreads(csc.getPurgerThreads());
         fcsBuilder.purgeSynchronously(csc.isPurgeSynchronously());

         fcsBuilder.location(csc.getLocation());
         fcsBuilder.fsyncInterval(csc.getFsyncInterval());
         fcsBuilder.fsyncMode(FileCacheStoreConfigurationBuilder.FsyncMode.valueOf(csc.getFsyncMode().name()));
         fcsBuilder.streamBufferSize(csc.getStreamBufferSize());
         loaderBuilder = fcsBuilder;
      } else if (clc instanceof CacheStoreConfig) {
         LegacyStoreConfigurationBuilder tmpStoreBuilder = builder.loaders().addStore();
         tmpStoreBuilder.cacheStore(Util.<CacheStore>getInstance(clc.getCacheLoaderClassName(), cl));
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         tmpStoreBuilder.fetchPersistentState(csc.isFetchPersistentState());
         tmpStoreBuilder.ignoreModifications(csc.isIgnoreModifications());
         tmpStoreBuilder.purgeOnStartup(csc.isPurgeOnStartup());
         tmpStoreBuilder.purgerThreads(csc.getPurgerThreads());
         tmpStoreBuilder.purgeSynchronously(csc.isPurgeSynchronously());
         loaderBuilder = tmpStoreBuilder;
         if (clc instanceof AbstractCacheStoreConfig) {
            tmpStoreBuilder.withProperties(((AbstractCacheLoaderConfig) clc).getProperties());
         }
      } else {
         LegacyLoaderConfigurationBuilder tmpLoaderBuilder = builder.loaders().addLoader();
         tmpLoaderBuilder.cacheLoader(Util.<CacheLoader>getInstance(clc.getCacheLoaderClassName(), cl));
         loaderBuilder = tmpLoaderBuilder;
      }
      if (clc instanceof CacheStoreConfig) {
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         StoreConfigurationBuilder<?, ?> storeBuilder = (StoreConfigurationBuilder<?, ?>) loaderBuilder;
         storeBuilder.async().enabled(csc.getAsyncStoreConfig().isEnabled());
         storeBuilder.async().flushLockTimeout(csc.getAsyncStoreConfig().getFlushLockTimeout());
         storeBuilder.async().modificationQueueSize(csc.getAsyncStoreConfig().getModificationQueueSize());
         storeBuilder.async().shutdownTimeout(csc.getAsyncStoreConfig().getShutdownTimeout());
         storeBuilder.async().threadPoolSize(csc.getAsyncStoreConfig().getThreadPoolSize());
         storeBuilder.singletonStore().enabled(csc.getSingletonStoreConfig().isSingletonStoreEnabled());
         storeBuilder.singletonStore().pushStateTimeout(csc.getSingletonStoreConfig().getPushStateTimeout());
         storeBuilder.singletonStore().pushStateWhenCoordinator(csc.getSingletonStoreConfig().isPushStateWhenCoordinator());
      }
   }

      return result;
   }

   @Override
   public FileCacheStoreConfig adapt() {
      FileCacheStoreConfig config = new FileCacheStoreConfig();

      LegacyConfigurationAdaptor.adapt(this, config);

      config.fsyncInterval(fsyncInterval);
      config.fsyncMode(FileCacheStoreConfig.FsyncMode.valueOf(fsyncMode.name()));
      config.streamBufferSize(streamBufferSize);
      config.location(location);

      XmlConfigHelper.setValues(config, properties(), false, true);

      return config;
   }

         ClusterCacheLoaderConfig cclc = (ClusterCacheLoaderConfig) clc;
         ClusterCacheLoaderConfigurationBuilder cclBuilder = builder.loaders().addClusterCacheLoader();
         cclBuilder.remoteCallTimeout(cclc.getRemoteCallTimeout());
         loaderBuilder = cclBuilder;
      } else if (clc instanceof FileCacheStoreConfig) {
         FileCacheStoreConfig csc = (FileCacheStoreConfig) clc;
         FileCacheStoreConfigurationBuilder fcsBuilder = builder.loaders().addFileCacheStore();

         fcsBuilder.fetchPersistentState(csc.isFetchPersistentState());
         fcsBuilder.ignoreModifications(csc.isIgnoreModifications());
         fcsBuilder.purgeOnStartup(csc.isPurgeOnStartup());
         fcsBuilder.purgerThreads(csc.getPurgerThreads());
         fcsBuilder.purgeSynchronously(csc.isPurgeSynchronously());

         fcsBuilder.location(csc.getLocation());
         fcsBuilder.fsyncInterval(csc.getFsyncInterval());
         fcsBuilder.fsyncMode(FileCacheStoreConfigurationBuilder.FsyncMode.valueOf(csc.getFsyncMode().name()));
         fcsBuilder.streamBufferSize(csc.getStreamBufferSize());
         loaderBuilder = fcsBuilder;
      } else if (clc instanceof CacheStoreConfig) {
         LegacyStoreConfigurationBuilder tmpStoreBuilder = builder.loaders().addStore();
         tmpStoreBuilder.cacheStore(Util.<CacheStore>getInstance(clc.getCacheLoaderClassName(), cl));
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         tmpStoreBuilder.fetchPersistentState(csc.isFetchPersistentState());
         tmpStoreBuilder.ignoreModifications(csc.isIgnoreModifications());
         tmpStoreBuilder.purgeOnStartup(csc.isPurgeOnStartup());
         tmpStoreBuilder.purgerThreads(csc.getPurgerThreads());
         tmpStoreBuilder.purgeSynchronously(csc.isPurgeSynchronously());
         loaderBuilder = tmpStoreBuilder;
         if (clc instanceof AbstractCacheStoreConfig) {
            tmpStoreBuilder.withProperties(((AbstractCacheLoaderConfig) clc).getProperties());
         }
      } else {
         LegacyLoaderConfigurationBuilder tmpLoaderBuilder = builder.loaders().addLoader();
         tmpLoaderBuilder.cacheLoader(Util.<CacheLoader>getInstance(clc.getCacheLoaderClassName(), cl));
         loaderBuilder = tmpLoaderBuilder;
      }
      if (clc instanceof CacheStoreConfig) {
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         StoreConfigurationBuilder<?, ?> storeBuilder = (StoreConfigurationBuilder<?, ?>) loaderBuilder;
         storeBuilder.async().enabled(csc.getAsyncStoreConfig().isEnabled());
         storeBuilder.async().flushLockTimeout(csc.getAsyncStoreConfig().getFlushLockTimeout());
         storeBuilder.async().modificationQueueSize(csc.getAsyncStoreConfig().getModificationQueueSize());
         storeBuilder.async().shutdownTimeout(csc.getAsyncStoreConfig().getShutdownTimeout());
         storeBuilder.async().threadPoolSize(csc.getAsyncStoreConfig().getThreadPoolSize());
         storeBuilder.singletonStore().enabled(csc.getSingletonStoreConfig().isSingletonStoreEnabled());
         storeBuilder.singletonStore().pushStateTimeout(csc.getSingletonStoreConfig().getPushStateTimeout());
         storeBuilder.singletonStore().pushStateWhenCoordinator(csc.getSingletonStoreConfig().isPushStateWhenCoordinator());
      }
   }

            .concurrencyLevel(1234).isolationLevel(IsolationLevel.SERIALIZABLE)
            .lockAcquisitionTimeout(8888L).useLockStriping(false).writeSkewCheck(true)
         .loaders()
            .shared(true).passivation(false)
            .addCacheLoader(
               new FileCacheStoreConfig()
                  .purgeOnStartup(true)
                  .location("/tmp/2").streamBufferSize(1615)
                  .asyncStore()
                     .threadPoolSize(14).flushLockTimeout(777L)
                     .shutdownTimeout(666L)
                  .fetchPersistentState(false).ignoreModifications(true)
                  .singletonStore()
                     .pushStateWhenCoordinator(true).pushStateTimeout(8989L)
                  .purgeSynchronously(false))
            .addCacheLoader(
               new DummyInMemoryCacheStore.Cfg()
                  .debug(true)
                  .failKey("fail")
                  .purgeOnStartup(false)
                  .asyncStore()
                     .threadPoolSize(21)
                  .purgeSynchronously(true))
            .addCacheLoader(
               new ClusterCacheLoaderConfig().remoteCallTimeout(7694L))
            .preload(true)
         .transaction()
            .cacheStopTimeout(1928).eagerLockSingleNode(false)
            .syncCommitPhase(true).syncRollbackPhase(false).useEagerLocking(false)
            .recovery()
               .recoveryInfoCacheName("mmmmmircea")
            .transactionManagerLookup(new DummyTransactionManagerLookup())
            .useSynchronization(true)
         .deadlockDetection()
            .spinDuration(8373L)
         .customInterceptors()
            .add(new OptimisticLockingInterceptor()).first()
            .add(new TxDistributionInterceptor()).last()
            .add(new CallInterceptor()).atIndex(8)
            .add(new CacheStoreInterceptor()).after(OptimisticLockingInterceptor.class)
            .add(new CacheLoaderInterceptor()).before(CallInterceptor.class)
         .eviction()
            .maxEntries(7676).strategy(EvictionStrategy.LIRS)
            .threadPolicy(EvictionThreadPolicy.PIGGYBACK)
         .expiration()
            .maxIdle(8392L).lifespan(4372L).wakeUpInterval(7585L)
         .clustering()
            .mode(Configuration.CacheMode.INVALIDATION_ASYNC)
            .async()
               .replQueueClass(ReplicationQueueImpl.class)
               .asyncMarshalling(false)
               .replQueueInterval(5738L)
               .replQueueMaxElements(19191)
               .useReplQueue(true)
            .l1()
               .lifespan(65738L).onRehash(true)
            .stateRetrieval()
               .alwaysProvideInMemoryState(false).fetchInMemoryState(true)
               .initialRetryWaitTime(8989L).retryWaitTimeIncreaseFactor(4)
               .numRetries(8).logFlushTimeout(533L).maxNonProgressingLogWrites(434)
               .timeout(7383L).chunkSize(1234)
            .hash()
               .hashFunctionClass(MurmurHash3.class)
               .consistentHashClass(DefaultConsistentHash.class)
               .numOwners(200).rehashWait(74843L).rehashRpcTimeout(374L)
               .rehashEnabled(false)
         .dataContainer()
            .dataContainerClass(DefaultDataContainer.class)
            .dataContainer(new QueryableDataContainer())
            .addProperty("a-property", "a-value")
         .indexing()
            .indexLocalOnly(true)
            .addProperty("indexing", "in memory")
         .unsafe()
            .unreliableReturnValues(false)
         .jmxStatistics()
         .storeAsBinary()
         .invocationBatching()
         .build();

      assert c.isInvocationBatchingEnabled();
      assert c.isStoreAsBinary();
      assert c.isExposeJmxStatistics();
      assert !c.isUnsafeUnreliableReturnValues();

      assert c.getDataContainer() instanceof QueryableDataContainer;
      assertEquals(DefaultDataContainer.class.getName(), c.getDataContainerClass());
      assertEquals("a-value", c.getDataContainerProperties().getProperty("a-property"));

      assert c.isIndexingEnabled();
      assert c.isIndexLocalOnly();
      assert c.getIndexingProperties().getProperty("indexing").equals("in memory");

      assert !c.isAlwaysProvideInMemoryState();
      assert c.isFetchInMemoryState();
      assert 8989L == c.getStateRetrievalInitialRetryWaitTime();
      assert 4 == c.getStateRetrievalRetryWaitTimeIncreaseFactor();
      assert 8 == c.getStateRetrievalNumRetries();
      assert 533L == c.getStateRetrievalLogFlushTimeout();
      assert 434 == c.getStateRetrievalMaxNonProgressingLogWrites();
      assert 7383L == c.getStateRetrievalTimeout();
      assert 1234 == c.getStateRetrievalChunkSize();
      assertEquals(MurmurHash3.class.getName(), c.getHashFunctionClass());
      assertEquals(DefaultConsistentHash.class.getName(), c.getConsistentHashClass());
      assert 200 == c.getNumOwners();
      assert 74843L == c.getRehashWaitTime();
      assert 374L == c.getRehashRpcTimeout();
      assert !c.isRehashEnabled();

      assert c.isL1CacheEnabled();
      assert c.isL1OnRehash();
      assert 65738L == c.getL1Lifespan();
      assert Configuration.CacheMode.INVALIDATION_ASYNC == c.getCacheMode();
      assert !c.isUseAsyncMarshalling();
      assertEquals(ReplicationQueueImpl.class.getName(), c.getReplQueueClass());
      assert 5738L == c.getReplQueueInterval();
      assert 19191 == c.getReplQueueMaxElements();
      assert c.isUseReplQueue();

      assert 4372L == c.getExpirationLifespan();
      assert 8392L == c.getExpirationMaxIdle();

      assert 7676 == c.getEvictionMaxEntries();
      assert EvictionStrategy.LIRS == c.getEvictionStrategy();
      assert EvictionThreadPolicy.PIGGYBACK == c.getEvictionThreadPolicy();
      assert 7585L == c.getExpirationWakeUpInterval();

      List<CustomInterceptorConfig> customInterceptors = c.getCustomInterceptors();
      assert customInterceptors.get(0).getInterceptor() instanceof OptimisticLockingInterceptor;
      assert customInterceptors.get(1).getInterceptor() instanceof BaseDistributionInterceptor;
      assert customInterceptors.get(2).getInterceptor() instanceof CallInterceptor;
      assert customInterceptors.get(3).getInterceptor() instanceof CacheStoreInterceptor;
      assert customInterceptors.get(4).getInterceptor() instanceof CacheLoaderInterceptor;

      assert c.isDeadlockDetectionEnabled();
      assert 8373L == c.getDeadlockDetectionSpinDuration();

      assert 1928 == c.getCacheStopTimeout();
      assert !c.isEagerLockSingleNode();
      assert c.isSyncCommitPhase();
      assert !c.isSyncRollbackPhase();
      assert !c.isUseEagerLocking();
      assert c.getTransactionManagerLookup() instanceof DummyTransactionManagerLookup;
      assert c.isTransactionRecoveryEnabled();
      assertEquals("mmmmmircea", c.getTransactionRecoveryCacheName());
      assert c.isUseSynchronizationForTransactions();

      ClusterCacheLoaderConfig clusterLoaderConfig = (ClusterCacheLoaderConfig) c.getCacheLoaders().get(2);
      assert 7694L == clusterLoaderConfig.getRemoteCallTimeout();

      DummyInMemoryCacheStore.Cfg dummyStoreConfig = (DummyInMemoryCacheStore.Cfg) c.getCacheLoaders().get(1);
      assert dummyStoreConfig.isDebug();
      assert !dummyStoreConfig.isPurgeOnStartup();
      assert dummyStoreConfig.isPurgeSynchronously();
      assert 21 == dummyStoreConfig.getAsyncStoreConfig().getThreadPoolSize();
      assert dummyStoreConfig.isPurgeSynchronously();

      FileCacheStoreConfig storeConfig = (FileCacheStoreConfig) c.getCacheLoaders().get(0);
      assertEquals("/tmp/2", storeConfig.getLocation());
      assert 1615 == storeConfig.getStreamBufferSize();
      assert storeConfig.isPurgeOnStartup();
      assert 14 == storeConfig.getAsyncStoreConfig().getThreadPoolSize();
      assert 777L == storeConfig.getAsyncStoreConfig().getFlushLockTimeout();
      assert 666L == storeConfig.getAsyncStoreConfig().getShutdownTimeout();
      assert !storeConfig.isFetchPersistentState();
      assert storeConfig.isIgnoreModifications();
      assert storeConfig.getSingletonStoreConfig().isPushStateWhenCoordinator();
      assert 8989L == storeConfig.getSingletonStoreConfig().getPushStateTimeout();
      assert !storeConfig.isPurgeSynchronously();

      assert c.isCacheLoaderShared();
      assert !c.isCacheLoaderPassivation();
      assert c.isCacheLoaderPreload();
      assert !c.isFetchPersistentState();

         ClusterCacheLoaderConfig cclc = (ClusterCacheLoaderConfig) clc;
         ClusterCacheLoaderConfigurationBuilder cclBuilder = builder.loaders().addClusterCacheLoader();
         cclBuilder.remoteCallTimeout(cclc.getRemoteCallTimeout());
         loaderBuilder = cclBuilder;
      } else if (clc instanceof FileCacheStoreConfig) {
         FileCacheStoreConfig csc = (FileCacheStoreConfig) clc;
         FileCacheStoreConfigurationBuilder fcsBuilder = builder.loaders().addFileCacheStore();

         fcsBuilder.fetchPersistentState(csc.isFetchPersistentState());
         fcsBuilder.ignoreModifications(csc.isIgnoreModifications());
         fcsBuilder.purgeOnStartup(csc.isPurgeOnStartup());
         fcsBuilder.purgerThreads(csc.getPurgerThreads());
         fcsBuilder.purgeSynchronously(csc.isPurgeSynchronously());

         fcsBuilder.location(csc.getLocation());
         fcsBuilder.fsyncInterval(csc.getFsyncInterval());
         fcsBuilder.fsyncMode(FileCacheStoreConfigurationBuilder.FsyncMode.valueOf(csc.getFsyncMode().name()));
         fcsBuilder.streamBufferSize(csc.getStreamBufferSize());
         loaderBuilder = fcsBuilder;
      } else if (clc instanceof CacheStoreConfig) {
         LegacyStoreConfigurationBuilder tmpStoreBuilder = builder.loaders().addStore();
         tmpStoreBuilder.cacheStore(Util.<CacheStore>getInstance(clc.getCacheLoaderClassName(), cl));
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         tmpStoreBuilder.fetchPersistentState(csc.isFetchPersistentState());
         tmpStoreBuilder.ignoreModifications(csc.isIgnoreModifications());
         tmpStoreBuilder.purgeOnStartup(csc.isPurgeOnStartup());
         tmpStoreBuilder.purgerThreads(csc.getPurgerThreads());
         tmpStoreBuilder.purgeSynchronously(csc.isPurgeSynchronously());
         loaderBuilder = tmpStoreBuilder;
         if (clc instanceof AbstractCacheStoreConfig) {
            tmpStoreBuilder.withProperties(((AbstractCacheLoaderConfig) clc).getProperties());
         }
      } else {
         LegacyLoaderConfigurationBuilder tmpLoaderBuilder = builder.loaders().addLoader();
         tmpLoaderBuilder.cacheLoader(Util.<CacheLoader>getInstance(clc.getCacheLoaderClassName(), cl));
         loaderBuilder = tmpLoaderBuilder;
      }
      if (clc instanceof CacheStoreConfig) {
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         CacheStoreConfigurationBuilder<?, ?> storeBuilder = (CacheStoreConfigurationBuilder<?, ?>) loaderBuilder;
         storeBuilder.async().enabled(csc.getAsyncStoreConfig().isEnabled());
         storeBuilder.async().flushLockTimeout(csc.getAsyncStoreConfig().getFlushLockTimeout());
         storeBuilder.async().modificationQueueSize(csc.getAsyncStoreConfig().getModificationQueueSize());
         storeBuilder.async().shutdownTimeout(csc.getAsyncStoreConfig().getShutdownTimeout());
         storeBuilder.async().threadPoolSize(csc.getAsyncStoreConfig().getThreadPoolSize());
         storeBuilder.singletonStore().enabled(csc.getSingletonStoreConfig().isSingletonStoreEnabled());
         storeBuilder.singletonStore().pushStateTimeout(csc.getSingletonStoreConfig().getPushStateTimeout());
         storeBuilder.singletonStore().pushStateWhenCoordinator(csc.getSingletonStoreConfig().isPushStateWhenCoordinator());
      }
   }

      return result;
   }

   @Override
   public FileCacheStoreConfig adapt() {
      FileCacheStoreConfig config = new FileCacheStoreConfig();

      LegacyConfigurationAdaptor.adapt(this, config);

      config.fsyncInterval(fsyncInterval);
      config.fsyncMode(FileCacheStoreConfig.FsyncMode.valueOf(fsyncMode.name()));
      config.streamBufferSize(streamBufferSize);
      config.location(location);

      XmlConfigHelper.setValues(config, properties(), false, true);

      return config;
   }

   protected void clearTempDir() {
      TestingUtil.recursiveFileRemove(tmpDirectory);
   }

   protected CacheStoreConfig createCacheStoreConfig() {
      FileCacheStoreConfig cfg = new FileCacheStoreConfig();
      cfg.setLocation(tmpDirectory);
      return cfg;
   }

TOP

Related Classes of org.infinispan.loaders.file.FileCacheStoreConfig

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.