Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheLoader


         }
      }
   }

   private void parseLoader(XMLStreamReader reader, ConfigurationBuilder builder) throws XMLStreamException {
      CacheLoader loader = null;
      Boolean fetchPersistentState = null;
      Boolean ignoreModifications = null;
      Boolean purgeOnStartup = null;
      Integer purgerThreads = null;
      Boolean purgeSynchronously = null;
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

      }
   }

   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

      }
   }

   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

         }
      }
   }

   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

      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

   protected void verifyNoData(Cache<Object, Object> c) {
      assert c.isEmpty() : "Cache should be empty!";
   }

   protected void verifyNoDataOnLoader(Cache<Object, Object> c) throws Exception {
      CacheLoader l = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheLoader();
      assert !l.containsKey(A_B_AGE);
      assert !l.containsKey(A_B_NAME);
      assert !l.containsKey(A_C_AGE);
      assert !l.containsKey(A_C_NAME);
      assert !l.containsKey(A_D_AGE);
      assert !l.containsKey(A_D_NAME);
   }
View Full Code Here

      c.evict(A_D_NAME);
      c.evict(A_D_AGE);
   }

   protected void verifyInitialDataOnLoader(Cache<Object, Object> c) throws Exception {
      CacheLoader l = TestingUtil.extractComponent(c, CacheLoaderManager.class).getCacheLoader();
      assert l.containsKey(A_B_AGE);
      assert l.containsKey(A_B_NAME);
      assert l.containsKey(A_C_AGE);
      assert l.containsKey(A_C_NAME);
      assert l.load(A_B_AGE).getValue().equals(TWENTY);
      assert l.load(A_B_NAME).getValue().equals(JOE);
      assert l.load(A_C_AGE).getValue().equals(FORTY);
      assert l.load(A_C_NAME).getValue().equals(BOB);
   }
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

   }
     
   @SuppressWarnings("unchecked")
   protected <KIn> Set<KIn> loadAllKeysFromCacheLoaderUsingFilter(Set<KIn> filterOutSet) {     
      Set<KIn> keysInCL = InfinispanCollections.<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

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.