Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.CacheStoreConfiguration


         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfiguration cfg : clmConfig.cacheLoaders()) {
            if (cfg instanceof CacheStoreConfiguration) {
               CacheStoreConfiguration scfg = (CacheStoreConfiguration) cfg;
               assertNotSingletonAndShared(scfg);
               if(scfg.fetchPersistentState()) numLoadersWithFetchPersistentState++;
            }
            if (numLoadersWithFetchPersistentState > 1)
               throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
View Full Code Here


   public void purgeIfNecessary() throws CacheLoaderException {
      loadersAndStoresMutex.readLock().lock();
      try {
         for (Map.Entry<CacheStore, CacheStoreConfiguration> e : stores.entrySet()) {
            CacheStoreConfiguration value = e.getValue();
            if (value.purgeOnStartup())
               e.getKey().clear();
         }
      } finally {
         loadersAndStoresMutex.readLock().unlock();
      }
View Full Code Here

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfiguration cfg : clmConfig.cacheLoaders()) {
            if (cfg instanceof CacheStoreConfiguration) {
               CacheStoreConfiguration scfg = (CacheStoreConfiguration) cfg;
               assertNotSingletonAndShared(scfg);
               if(scfg.fetchPersistentState()) numLoadersWithFetchPersistentState++;
            }
            if (numLoadersWithFetchPersistentState > 1)
               throw log.multipleCacheStoresWithFetchPersistentState();

            CacheLoader l = createCacheLoader(cfg, cache);
View Full Code Here

      if (tmpLoader != null) {
         if (cfg instanceof CacheStoreConfiguration) {
            CacheStore tmpStore = (CacheStore) tmpLoader;
            // async?
            CacheStoreConfiguration cfg2 = (CacheStoreConfiguration) cfg;
            if (cfg2.async().enabled()) {
               tmpStore = createAsyncStore(tmpStore);
               tmpLoader = tmpStore;
            }

            // read only?
            if (cfg2.ignoreModifications()) {
               tmpStore = new ReadOnlyStore(tmpStore);
               tmpLoader = tmpStore;
            }

            // singleton?
            if (cfg2.singletonStore().enabled()) {
               tmpStore = new SingletonStore(tmpStore, cache);
               tmpLoader = tmpStore;
            }
         }
View Full Code Here

   public void purgeIfNecessary() throws CacheLoaderException {
      loadersAndStoresMutex.readLock().lock();
      try {
         for (Map.Entry<CacheStore, CacheStoreConfiguration> e : stores.entrySet()) {
            CacheStoreConfiguration value = e.getValue();
            if (value.purgeOnStartup())
               e.getKey().clear();
         }
      } finally {
         loadersAndStoresMutex.readLock().unlock();
      }
View Full Code Here

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfiguration cfg : clmConfig.cacheLoaders()) {
            if (cfg instanceof CacheStoreConfiguration) {
               CacheStoreConfiguration scfg = (CacheStoreConfiguration) cfg;
               assertNotSingletonAndShared(scfg);
               if(scfg.fetchPersistentState()) numLoadersWithFetchPersistentState++;
            }
            if (numLoadersWithFetchPersistentState > 1)
               throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
View Full Code Here

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfiguration cfg : clmConfig.cacheLoaders()) {
            if (cfg instanceof CacheStoreConfiguration) {
               CacheStoreConfiguration scfg = (CacheStoreConfiguration) cfg;
               assertNotSingletonAndShared(scfg);
               if(scfg.fetchPersistentState()) numLoadersWithFetchPersistentState++;
            }
            if (numLoadersWithFetchPersistentState > 1)
               throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
View Full Code Here

   public void purgeIfNecessary() throws CacheLoaderException {
      loadersAndStoresMutex.readLock().lock();
      try {
         for (Map.Entry<CacheStore, CacheStoreConfiguration> e : stores.entrySet()) {
            CacheStoreConfiguration value = e.getValue();
            if (value.purgeOnStartup())
               e.getKey().clear();
         }
      } finally {
         loadersAndStoresMutex.readLock().unlock();
      }
View Full Code Here

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfiguration cfg : clmConfig.cacheLoaders()) {
            if (cfg instanceof CacheStoreConfiguration) {
               CacheStoreConfiguration scfg = (CacheStoreConfiguration) cfg;
               assertNotSingletonAndShared(scfg);
               if(scfg.fetchPersistentState()) numLoadersWithFetchPersistentState++;
            }
            if (numLoadersWithFetchPersistentState > 1)
               throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
View Full Code Here

   public void purgeIfNecessary() throws CacheLoaderException {
      loadersAndStoresMutex.readLock().lock();
      try {
         for (Map.Entry<CacheStore, CacheStoreConfiguration> e : stores.entrySet()) {
            CacheStoreConfiguration value = e.getValue();
            if (value.purgeOnStartup())
               e.getKey().clear();
         }
      } finally {
         loadersAndStoresMutex.readLock().unlock();
      }
View Full Code Here

TOP

Related Classes of org.infinispan.configuration.cache.CacheStoreConfiguration

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.