Package org.infinispan.loaders

Examples of org.infinispan.loaders.CacheLoader


         .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(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

      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

         }
      }
   }

   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(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

      for (Element element : elements) {
         String clClass = parser.getAttributeValue(element, "class");
         if (!parser.existsAttribute(clClass))
            throw new ConfigurationException("Missing 'class'  attribute for cache loader configuration");

         CacheLoader cl;
         CacheLoaderConfig clc;
         try {
            cl = (CacheLoader) Util.getInstance(clClass);
            clc = Util.getInstance(cl.getConfigurationClass());
         } catch (Exception ex) {
            throw new ConfigurationException("Unable to instantiate cache loader or configuration",ex);
         }

         clc.setCacheLoaderClassName(clClass);
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

   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

         }
      }
   }

   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

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.