Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheLoader


         }
      }
   }

   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


   }

   public static CacheLoaderConfig adapt(AbstractLoaderConfiguration loader) {
      CacheLoaderConfig clc = null;
      if (loader instanceof LoaderConfiguration) {
         CacheLoader cacheLoader = ((LoaderConfiguration) loader).cacheLoader();
         if (cacheLoader.getClass().isAnnotationPresent(CacheLoaderMetadata.class)) {
            clc = Util.getInstance(cacheLoader.getClass().getAnnotation(CacheLoaderMetadata.class).configurationClass());
         } else {
            AbstractCacheStoreConfig acsc = new AbstractCacheStoreConfig();
            acsc.setCacheLoaderClassName(((LoaderConfiguration) loader).cacheLoader().getClass().getName());
            clc = acsc;
         }
View Full Code Here

   }
     
   @SuppressWarnings("unchecked")
   protected <KIn> Set<KIn> loadAllKeysFromCacheLoaderUsingFilter(Set<KIn> filterOutSet) {     
      Set<KIn> keysInCL = Collections.<KIn> emptySet();
      CacheLoader cl = resolveCacheLoader();
      if (cl != null) {
         try {
            keysInCL = (Set<KIn>) cl.loadAllKeys((Set<Object>) filterOutSet);
         } catch (CacheLoaderException e) {
            throw new CacheException("Could not load key/value entries from cacheloader", e);
         }
      }
      return keysInCL;
View Full Code Here

   }
  
   @SuppressWarnings("unchecked")
   protected <KIn, KOut> KOut loadValueFromCacheLoader(KIn key) {     
      KOut value = null;
      CacheLoader cl = resolveCacheLoader();
      if (cl != null) {
         try {
            InternalCacheEntry entry = cl.load(key);
            if (entry != null) {
               value = (KOut) entry.getValue();
            }
         } catch (CacheLoaderException e) {
            throw new CacheException("Could not load key/value entries from cacheloader", e);
View Full Code Here

      }
      return value;
   }
  
   protected CacheLoader resolveCacheLoader(){
      CacheLoader cl = null;
      if (cacheLoaderManager != null && cacheLoaderManager.isEnabled()){
         cl = cacheLoaderManager.getCacheLoader();
      }
      return cl;
   }
View Full Code Here

   public void simpleTest() throws Exception {
      withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.fromXml(CACHE_LOADER_CONFIG)) {
         @Override
         public void call() {
            Cache<Object, Object> cache = cm.getCache();
            CacheLoader cacheLoader = TestingUtil.getCacheLoader(cache);
            assert cacheLoader != null;
            assert cacheLoader instanceof RemoteCacheStore;


            cache.put("k", "v");
View Full Code Here

   }
     
   @SuppressWarnings("unchecked")
   protected <KIn> Set<KIn> loadAllKeysFromCacheLoaderUsingFilter(Set<KIn> filterOutSet) {     
      Set<KIn> keysInCL = Collections.<KIn> emptySet();
      CacheLoader cl = resolveCacheLoader();
      if (cl != null) {
         try {
            keysInCL = (Set<KIn>) cl.loadAllKeys((Set<Object>) filterOutSet);
         } catch (CacheLoaderException e) {
            throw new CacheException("Could not load key/value entries from cacheloader", e);
         }
      }
      return keysInCL;
View Full Code Here

   }
  
   @SuppressWarnings("unchecked")
   protected <KIn, KOut> KOut loadValueFromCacheLoader(KIn key) {     
      KOut value = null;
      CacheLoader cl = resolveCacheLoader();
      if (cl != null) {
         try {
            InternalCacheEntry entry = cl.load(key);
            if (entry != null) {
               value = (KOut) entry.getValue();
            }
         } catch (CacheLoaderException e) {
            throw new CacheException("Could not load key/value entries from cacheloader", e);
View Full Code Here

      }
      return value;
   }
  
   protected CacheLoader resolveCacheLoader(){
      CacheLoader cl = null;
      if (cacheLoaderManager != null && cacheLoaderManager.isEnabled()){
         cl = cacheLoaderManager.getCacheLoader();
      }
      return cl;
   }
View Full Code Here

         .shared(config.loaders().shared());

      for (AbstractLoaderConfiguration loader : config.loaders().cacheLoaders()) {
         CacheLoaderConfig clc = null;
         if (loader instanceof LoaderConfiguration) {
            CacheLoader cacheLoader = ((LoaderConfiguration) loader).cacheLoader();
            if (cacheLoader.getClass().isAnnotationPresent(CacheLoaderMetadata.class)) {
               clc = Util.getInstance(cacheLoader.getClass().getAnnotation(CacheLoaderMetadata.class).configurationClass());
            } else {
               AbstractCacheStoreConfig acsc = new AbstractCacheStoreConfig();
               acsc.setCacheLoaderClassName(((LoaderConfiguration) loader).cacheLoader().getClass().getName());
               clc = acsc;
            }
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.