Package org.infinispan.loaders

Examples of org.infinispan.loaders.AbstractCacheStoreConfig


         AbstractCacheLoaderConfig aclc = (AbstractCacheLoaderConfig) legacy;
         aclc.setProperties(configuration.properties());
      }
      XmlConfigHelper.setValues(legacy, configuration.properties(), false, true);
      if (legacy instanceof AbstractCacheStoreConfig) {
         AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) legacy;
         acsc.fetchPersistentState(configuration.fetchPersistentState());
         acsc.ignoreModifications(configuration.ignoreModifications());
         acsc.purgeOnStartup(configuration.purgeOnStartup());
         acsc.purgeSynchronously(configuration.purgeSynchronously());
         acsc.purgerThreads(configuration.purgerThreads());

         acsc.getAsyncStoreConfig().setEnabled(configuration.async().enabled());
         acsc.getAsyncStoreConfig().flushLockTimeout(configuration.async().flushLockTimeout());
         acsc.getAsyncStoreConfig().modificationQueueSize(configuration.async().modificationQueueSize());
         acsc.getAsyncStoreConfig().shutdownTimeout(configuration.async().shutdownTimeout());
         acsc.getAsyncStoreConfig().threadPoolSize(configuration.async().threadPoolSize());
         acsc.getSingletonStoreConfig().enabled(configuration.singletonStore().enabled());
         acsc.getSingletonStoreConfig().pushStateTimeout(configuration.singletonStore().pushStateTimeout());
         acsc.getSingletonStoreConfig().pushStateWhenCoordinator(configuration.singletonStore().pushStateWhenCoordinator());
      }

      delegate = (org.infinispan.loaders.CacheStore) Util.getInstance(configuration.cacheStore().getClass());
      delegate.init(legacy, cache, m != null ? new StreamingMarshallerAdapter(m) : null);
   }
View Full Code Here


      } 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();
         acsc.setProperties(p);
         if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
         if (loader instanceof LegacyStoreConfiguration)
            acsc.purgerThreads(((LegacyStoreConfiguration)loader).purgerThreads());
      } else if (clc instanceof CacheLoaderConfig) {
         Properties p = loader.properties();
         if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
      }
      return clc;
View Full Code Here

   private static CacheLoaderConfig getLoaderConfig(CacheLoaderConfiguration loader, CacheLoader cacheLoader) {
      if (cacheLoader.getClass().isAnnotationPresent(CacheLoaderMetadata.class)) {
         return Util.getInstance(cacheLoader.getClass().getAnnotation(CacheLoaderMetadata.class).configurationClass());
      } else {
         AbstractCacheStoreConfig acsc = new AbstractCacheStoreConfig();
         if (loader instanceof LegacyStoreConfiguration) {
            acsc.setCacheLoaderClassName(((LegacyStoreConfiguration) loader).cacheStore().getClass().getName());
         } else {
            acsc.setCacheLoaderClassName(((LegacyLoaderConfiguration) loader).cacheLoader().getClass().getName());
         }
         return acsc;
      }
   }
View Full Code Here

      } 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();
         acsc.setProperties(p);
         if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
         if (loader instanceof LegacyStoreConfiguration)
            acsc.purgerThreads(((LegacyStoreConfiguration)loader).purgerThreads());
      } else if (clc instanceof CacheLoaderConfig) {
         Properties p = loader.properties();
         if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
      }
      return clc;
View Full Code Here

   private static CacheLoaderConfig getLoaderConfig(CacheLoaderConfiguration loader, CacheLoader cacheLoader) {
      if (cacheLoader.getClass().isAnnotationPresent(CacheLoaderMetadata.class)) {
         return Util.getInstance(cacheLoader.getClass().getAnnotation(CacheLoaderMetadata.class).configurationClass());
      } else {
         AbstractCacheStoreConfig acsc = new AbstractCacheStoreConfig();
         if (loader instanceof LegacyStoreConfiguration) {
            acsc.setCacheLoaderClassName(((LegacyStoreConfiguration) loader).cacheStore().getClass().getName());
         } else {
            acsc.setCacheLoaderClassName(((LegacyLoaderConfiguration) loader).cacheLoader().getClass().getName());
         }
         return acsc;
      }
   }
View Full Code Here

         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;
            }
           
         } else if (loader instanceof FileCacheStoreConfiguration) {
            FileCacheStoreConfig fcsc = new FileCacheStoreConfig();
            clc = fcsc;
            FileCacheStoreConfiguration store = (FileCacheStoreConfiguration) loader;
            if (store.location() != null) {
               fcsc.location(store.location());
            }
            if (store.fsyncMode() != null) {
               fcsc.fsyncMode(FileCacheStoreConfig.FsyncMode.valueOf(store.fsyncMode().name()));
            }
            fcsc.fsyncInterval(store.fsyncInterval());
            fcsc.streamBufferSize(store.streamBufferSize());
         }
         if (clc instanceof CacheStoreConfig) {
            CacheStoreConfig csc = (CacheStoreConfig) clc;
            csc.fetchPersistentState(loader.fetchPersistentState());
            csc.ignoreModifications(loader.ignoreModifications());
            csc.purgeOnStartup(loader.purgeOnStartup())
            csc.setPurgeSynchronously(loader.purgeSynchronously());
            csc.getAsyncStoreConfig().setEnabled(loader.async().enabled());
            csc.getAsyncStoreConfig().flushLockTimeout(loader.async().flushLockTimeout());
            csc.getAsyncStoreConfig().modificationQueueSize(loader.async().modificationQueueSize());
            csc.getAsyncStoreConfig().shutdownTimeout(loader.async().shutdownTimeout());
            csc.getAsyncStoreConfig().threadPoolSize(loader.async().threadPoolSize());
           
            csc.getSingletonStoreConfig().enabled(loader.singletonStore().enabled());
            csc.getSingletonStoreConfig().pushStateTimeout(loader.singletonStore().pushStateTimeout());
            csc.getSingletonStoreConfig().pushStateWhenCoordinator(loader.singletonStore().pushStateWhenCoordinator());
         }
         if (clc instanceof AbstractCacheStoreConfig) {
            AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) clc;
            Properties p = loader.properties();
            acsc.setProperties(p);
            if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
            if (loader instanceof LoaderConfiguration)
               acsc.purgerThreads(((LoaderConfiguration) loader).purgerThreads());
         }
        
         legacy.loaders().addCacheLoader(clc);
      }
     
View Full Code Here

         .passivation(config.loaders().passivation())
         .preload(config.loaders().preload())
         .shared(config.loaders().shared());

      for (LoaderConfiguration loader : config.loaders().cacheLoaders()) {
         AbstractCacheStoreConfig csc = new AbstractCacheStoreConfig();
         csc.setCacheLoaderClassName(loader.cacheLoader().getClass().getName());
         csc.fetchPersistentState(loader.fetchPersistentState());
         csc.ignoreModifications(loader.ignoreModifications());
         csc.purgeOnStartup(loader.purgeOnStartup());
         csc.purgerThreads(loader.purgerThreads());
         csc.setPurgeSynchronously(loader.purgeSynchronously());
         csc.getAsyncStoreConfig().setEnabled(loader.async().enabled());
         csc.getAsyncStoreConfig().flushLockTimeout(loader.async().flushLockTimeout());
         csc.getAsyncStoreConfig().modificationQueueSize(loader.async().modificationQueueSize());
         csc.getAsyncStoreConfig().shutdownTimeout(loader.async().shutdownTimeout());
         csc.getAsyncStoreConfig().threadPoolSize(loader.async().threadPoolSize());
         csc.setProperties(loader.properties());
         csc.getSingletonStoreConfig().enabled(loader.singletonStore().enabled());
         csc.getSingletonStoreConfig().pushStateTimeout(loader.singletonStore().pushStateTimeout());
         csc.getSingletonStoreConfig().pushStateWhenCoordinator(loader.singletonStore().pushStateWhenCoordinator());
         legacy.loaders().addCacheLoader(csc);
      }
     
      legacy.locking()
         .concurrencyLevel(config.locking().concurrencyLevel())
View Full Code Here

         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;
            }
           
         } else if (loader instanceof FileCacheStoreConfiguration) {
            FileCacheStoreConfig fcsc = new FileCacheStoreConfig();
            clc = fcsc;
            FileCacheStoreConfiguration store = (FileCacheStoreConfiguration) loader;
            if (store.location() != null) {
               fcsc.location(store.location());
            }
            if (store.fsyncMode() != null) {
               fcsc.fsyncMode(FileCacheStoreConfig.FsyncMode.valueOf(store.fsyncMode().name()));
            }
            fcsc.fsyncInterval(store.fsyncInterval());
            fcsc.streamBufferSize(store.streamBufferSize());
         }
         if (clc instanceof CacheStoreConfig) {
            CacheStoreConfig csc = (CacheStoreConfig) clc;
            csc.fetchPersistentState(loader.fetchPersistentState());
            csc.ignoreModifications(loader.ignoreModifications());
            csc.purgeOnStartup(loader.purgeOnStartup())
            csc.setPurgeSynchronously(loader.purgeSynchronously());
            csc.getAsyncStoreConfig().setEnabled(loader.async().enabled());
            csc.getAsyncStoreConfig().flushLockTimeout(loader.async().flushLockTimeout());
            csc.getAsyncStoreConfig().modificationQueueSize(loader.async().modificationQueueSize());
            csc.getAsyncStoreConfig().shutdownTimeout(loader.async().shutdownTimeout());
            csc.getAsyncStoreConfig().threadPoolSize(loader.async().threadPoolSize());
           
            csc.getSingletonStoreConfig().enabled(loader.singletonStore().enabled());
            csc.getSingletonStoreConfig().pushStateTimeout(loader.singletonStore().pushStateTimeout());
            csc.getSingletonStoreConfig().pushStateWhenCoordinator(loader.singletonStore().pushStateWhenCoordinator());
         }
         if (clc instanceof AbstractCacheStoreConfig) {
            AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) clc;
            Properties p = loader.properties();
            acsc.setProperties(p);
            if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
            if (loader instanceof LoaderConfiguration)
               acsc.purgerThreads(((LoaderConfiguration) loader).purgerThreads());
         }
        
         legacy.loaders().addCacheLoader(clc);
      }
     
View Full Code Here

         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;
            }
           
         } else if (loader instanceof FileCacheStoreConfiguration) {
            FileCacheStoreConfig fcsc = new FileCacheStoreConfig();
            clc = fcsc;
            FileCacheStoreConfiguration store = (FileCacheStoreConfiguration) loader;
            if (store.location() != null) {
               fcsc.location(store.location());
            }
            if (store.fsyncMode() != null) {
               fcsc.fsyncMode(FileCacheStoreConfig.FsyncMode.valueOf(store.fsyncMode().name()));
            }
            fcsc.fsyncInterval(store.fsyncInterval());
            fcsc.streamBufferSize(store.streamBufferSize());
         }
         if (clc instanceof CacheStoreConfig) {
            CacheStoreConfig csc = (CacheStoreConfig) clc;
            csc.fetchPersistentState(loader.fetchPersistentState());
            csc.ignoreModifications(loader.ignoreModifications());
            csc.purgeOnStartup(loader.purgeOnStartup())
            csc.setPurgeSynchronously(loader.purgeSynchronously());
            csc.getAsyncStoreConfig().setEnabled(loader.async().enabled());
            csc.getAsyncStoreConfig().flushLockTimeout(loader.async().flushLockTimeout());
            csc.getAsyncStoreConfig().modificationQueueSize(loader.async().modificationQueueSize());
            csc.getAsyncStoreConfig().shutdownTimeout(loader.async().shutdownTimeout());
            csc.getAsyncStoreConfig().threadPoolSize(loader.async().threadPoolSize());
           
            csc.getSingletonStoreConfig().enabled(loader.singletonStore().enabled());
            csc.getSingletonStoreConfig().pushStateTimeout(loader.singletonStore().pushStateTimeout());
            csc.getSingletonStoreConfig().pushStateWhenCoordinator(loader.singletonStore().pushStateWhenCoordinator());
         }
         if (clc instanceof AbstractCacheStoreConfig) {
            AbstractCacheStoreConfig acsc = (AbstractCacheStoreConfig) clc;
            Properties p = loader.properties();
            acsc.setProperties(p);
            if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
            if (loader instanceof LoaderConfiguration)
               acsc.purgerThreads(((LoaderConfiguration) loader).purgerThreads());
         }
        
         legacy.loaders().addCacheLoader(clc);
      }
     
View Full Code Here

      } 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();
         acsc.setProperties(p);
         if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
         if (loader instanceof LegacyStoreConfiguration)
            acsc.purgerThreads(((LegacyStoreConfiguration)loader).purgerThreads());
      } else if (clc instanceof CacheLoaderConfig) {
         Properties p = loader.properties();
         if (p != null) XmlConfigHelper.setValues(clc, p, false, true);
      }
      return clc;
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.AbstractCacheStoreConfig

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.