Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheLoader


      return TestCacheManagerFactory.createCacheManager(builder);
   }

   public void testFilteredKeyLoad() throws CacheLoaderException {
      CacheLoaderManager cacheLoaderManager = TestingUtil.extractComponent(cache, CacheLoaderManager.class);
      CacheLoader loader = cacheLoaderManager.getCacheLoader();
      AssertJUnit.assertNotNull(loader);
      AssertJUnit.assertTrue(loader instanceof LuceneCacheLoader);
      LuceneCacheLoader cacheLoader = (LuceneCacheLoader) loader;
      cacheLoader.loadAllKeys(null);
   }
View Full Code Here


      }
   }

   private void parseLoader(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
     ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
      CacheLoader loader = null;
      Boolean fetchPersistentState = null;
      Boolean ignoreModifications = null;
      Boolean purgeOnStartup = null;
      Integer purgerThreads = null;
      Boolean purgeSynchronously = null;
View Full Code Here

      if (loader instanceof LegacyLoaderAdapter<?>) {
         return ((LegacyLoaderAdapter<?>)loader).adapt();
      } else if (loader instanceof StoreConfiguration) {
         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;
         StoreConfiguration store = (StoreConfiguration) loader;
         adapt(store, csc);
      } else if (loader instanceof LegacyLoaderConfiguration) {
         CacheLoader cacheLoader = ((LegacyLoaderConfiguration) loader).cacheLoader();
         clc = getLoaderConfig(loader, cacheLoader);
      }
      if (clc instanceof AbstractCacheStoreConfig) {
         AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) clc;
         Properties p = loader.properties();
View Full Code Here

      if (loader instanceof LegacyLoaderAdapter<?>) {
         return ((LegacyLoaderAdapter<?>)loader).adapt();
      } else if (loader instanceof StoreConfiguration) {
         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;
         StoreConfiguration store = (StoreConfiguration) loader;
         csc.fetchPersistentState(store.fetchPersistentState());
         csc.ignoreModifications(store.ignoreModifications());
         csc.purgeOnStartup(store.purgeOnStartup());
         csc.setPurgeSynchronously(store.purgeSynchronously());
         csc.getAsyncStoreConfig().setEnabled(store.async().enabled());
         csc.getAsyncStoreConfig().flushLockTimeout(store.async().flushLockTimeout());
         csc.getAsyncStoreConfig().modificationQueueSize(store.async().modificationQueueSize());
         csc.getAsyncStoreConfig().shutdownTimeout(store.async().shutdownTimeout());
         csc.getAsyncStoreConfig().threadPoolSize(store.async().threadPoolSize());
         csc.getSingletonStoreConfig().enabled(store.singletonStore().enabled());
         csc.getSingletonStoreConfig().pushStateTimeout(store.singletonStore().pushStateTimeout());
         csc.getSingletonStoreConfig().pushStateWhenCoordinator(store.singletonStore().pushStateWhenCoordinator());
      } else if (loader instanceof LegacyLoaderConfiguration) {
         CacheLoader cacheLoader = ((LegacyLoaderConfiguration) loader).cacheLoader();
         clc = getLoaderConfig(loader, cacheLoader);
      }
      if (clc instanceof AbstractCacheStoreConfig) {
         AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) clc;
         Properties p = loader.properties();
View Full Code Here

         }
      }
   }

   private void parseLoader(XMLStreamReader reader, ConfigurationBuilder builder, ClassLoader cl) throws XMLStreamException {
      CacheLoader loader = null;
      Boolean fetchPersistentState = null;
      Boolean ignoreModifications = null;
      Boolean purgeOnStartup = null;
      Integer purgerThreads = null;
      Boolean purgeSynchronously = null;
View Full Code Here

                properties.setProperty("tcpNoDelay", store.require(ModelKeys.TCP_NO_DELAY).asString());
            }
        } else {
            String className = store.require(ModelKeys.CLASS).asString();
            try {
                CacheLoader loader = CacheLoader.class.getClassLoader().loadClass(className).asSubclass(CacheLoader.class).newInstance();
                builder.cacheLoader(loader);
            } catch (Exception e) {
                throw new IllegalArgumentException(String.format("%s is not a valid cache store", className), e);
            }
        }
View Full Code Here

      }
   }

   private void parseLoader(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
     ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
      CacheLoader loader = null;
      Boolean fetchPersistentState = null;
      Boolean ignoreModifications = null;
      Boolean purgeOnStartup = null;
      Integer purgerThreads = null;
      Boolean purgeSynchronously = null;
View Full Code Here

      if (loader instanceof LegacyLoaderAdapter<?>) {
         return ((LegacyLoaderAdapter<?>)loader).adapt();
      } else if (loader instanceof CacheStoreConfiguration) {
         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);
      }
      if (clc instanceof AbstractCacheStoreConfig) {
         AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) clc;
         Properties p = loader.properties();
View Full Code Here

   @SuppressWarnings("unchecked")
   public <T extends CacheLoader> List<T> getCacheLoaders(Class<T> loaderClass) {
      Set<T> matchingLoaders = new LinkedHashSet<T>();

      for (CacheStore cs : stores.keySet()) {
         CacheLoader ucs = undelegateCacheLoader(cs);
         if (loaderClass.isInstance(ucs)) matchingLoaders.add((T) ucs);
      }

      for (CacheLoader cl : loaders.keySet()) {
         if (loaderClass.isInstance(cl)) matchingLoaders.add((T) cl);
View Full Code Here

      }
   }

   private void parseLoader(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
     ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
      CacheLoader loader = null;
      Boolean fetchPersistentState = null;
      Boolean ignoreModifications = null;
      Boolean purgeOnStartup = null;
      Integer purgerThreads = null;
      Boolean purgeSynchronously = null;
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.CacheLoader

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.