Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheStoreConfig


   private boolean hasAsyncStore() {
      List<CacheLoaderConfig> loaderConfigs = configuration.getCacheLoaderManagerConfig().getCacheLoaderConfigs();
      for (CacheLoaderConfig loaderConfig : loaderConfigs) {
         if (loaderConfig instanceof CacheStoreConfig) {
            CacheStoreConfig storeConfig = (CacheStoreConfig) loaderConfig;
            if (storeConfig.getAsyncStoreConfig().isEnabled())
               return true;
         }
      }
      return false;
   }
View Full Code Here


      boolean shared = cacheLoaderManagerConfig.isShared();
      if (!shared) {
         for (CacheLoaderConfig loaderConfig : cacheLoaderManagerConfig.getCacheLoaderConfigs()) {
            if (loaderConfig instanceof CacheStoreConfig) {
               CacheStoreConfig storeConfig = (CacheStoreConfig)loaderConfig;
               Boolean fetchPersistentState = storeConfig.isFetchPersistentState();
               Boolean purgeOnStartup = storeConfig.isPurgeOnStartup();
               if (!fetchPersistentState && !purgeOnStartup) {
                  log.staleEntriesWithoutFetchPersistentStateOrPurgeOnStartup();
               }
            }
         }
View Full Code Here

      boolean shared = cacheLoaderManagerConfig.isShared();
      if (!shared) {
         for (CacheLoaderConfig loaderConfig : cacheLoaderManagerConfig.getCacheLoaderConfigs()) {
            if (loaderConfig instanceof CacheStoreConfig) {
               CacheStoreConfig storeConfig = (CacheStoreConfig)loaderConfig;
               Boolean fetchPersistentState = storeConfig.isFetchPersistentState();
               Boolean purgeOnStartup = storeConfig.isPurgeOnStartup();
               if (!fetchPersistentState && !purgeOnStartup) {
                  log.staleEntriesWithoutFetchPersistentStateOrPurgeOnStartup();
               }
            }
         }
View Full Code Here

         if (loader instanceof LegacyStoreConfiguration) {
            LegacyStoreConfiguration store = (LegacyStoreConfiguration) loader;
            CacheLoader cacheStore = store.cacheStore(); // TODO: in 6.0, as we deprecate the LegacyConfigurationLoader#cacheLoader() method, narrow this type to CacheStore
            clc = getLoaderConfig(loader, cacheStore);
         }
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         CacheStoreConfiguration store = (CacheStoreConfiguration) loader;
         adapt(store, csc);
      } else if (loader instanceof LegacyLoaderConfiguration) {
         CacheLoader cacheLoader = ((LegacyLoaderConfiguration) loader).cacheLoader();
         clc = getLoaderConfig(loader, cacheLoader);
View Full Code Here

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

         if (loader instanceof LegacyStoreConfiguration) {
            LegacyStoreConfiguration store = (LegacyStoreConfiguration) loader;
            CacheLoader cacheStore = store.cacheStore(); // TODO: in 6.0, as we deprecate the LegacyConfigurationLoader#cacheLoader() method, narrow this type to CacheStore
            clc = getLoaderConfig(loader, cacheStore);
         }
         CacheStoreConfig csc = (CacheStoreConfig) clc;
         CacheStoreConfiguration store = (CacheStoreConfiguration) loader;
         adapt(store, csc);
      } else if (loader instanceof LegacyLoaderConfiguration) {
         CacheLoader cacheLoader = ((LegacyLoaderConfiguration) loader).cacheLoader();
         clc = getLoaderConfig(loader, cacheLoader);
View Full Code Here

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

   private Configuration createConfiguration(int id) {
      Configuration cfg = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);
      cfg.fluent().clustering().stateRetrieval().fetchInMemoryState(false);
      CacheLoaderManagerConfig clmc = new CacheLoaderManagerConfig();
      CacheStoreConfig clc = new DummyInMemoryCacheStore.Cfg("store id: " + id);
      clmc.addCacheLoaderConfig(clc);
      clc.setFetchPersistentState(true);
      clmc.setShared(false);
      cfg.setCacheLoaderManagerConfig(clmc);
      return cfg;
   }
View Full Code Here

      enableTestJdbcStorage(configuration);
      return TestCacheManagerFactory.createCacheManager(configuration);
   }

   private void enableTestJdbcStorage(Configuration configuration) throws Exception {
      CacheStoreConfig fileStoreConfiguration = createCacheStoreConfig();
      AsyncStoreConfig asyncStoreConfig = new AsyncStoreConfig();
      asyncStoreConfig.setEnabled(true);
      asyncStoreConfig.setThreadPoolSize(1);
      fileStoreConfiguration.setAsyncStoreConfig(asyncStoreConfig);
      CacheLoaderManagerConfig loaderManagerConfig = configuration.getCacheLoaderManagerConfig();
      loaderManagerConfig.setPassivation(false);
      loaderManagerConfig.setPreload(false);
      loaderManagerConfig.setShared(true);
      loaderManagerConfig.addCacheLoaderConfig(fileStoreConfiguration);
View Full Code Here

   private static final long lifespan = 6000000;

   @Override
   protected CacheStore createCacheStore() throws CacheLoaderException {
      ChainingCacheStore store = new ChainingCacheStore();
      CacheStoreConfig cfg = new DummyInMemoryCacheStore.Cfg()
         .storeName("ChainingCacheLoaderTest_instance1")
         .purgeOnStartup(false)
         .fetchPersistentState(false);
      store1 = new DummyInMemoryCacheStore();
      store1.init(cfg, null, new TestObjectStreamMarshaller());
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.CacheStoreConfig

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.