Package org.infinispan.loaders.decorators

Examples of org.infinispan.loaders.decorators.ChainingCacheStore


    * This method returns a collection of cache loader types (fully qualified class names) that are configured and enabled.
    */
   public Collection<String> getCacheLoaders() {
      if (enabled && clm.isEnabled()) {
         if (loader instanceof ChainingCacheStore) {
            ChainingCacheStore chainingStore = (ChainingCacheStore) loader;
            LinkedHashMap<CacheStore, StoreConfiguration> stores = chainingStore.getStores();
            Set<String> storeTypes = new HashSet<String>(stores.size());
            for (CacheStore cs : stores.keySet()) storeTypes.add(cs.getClass().getName());
            return storeTypes;
         } else {
            return Collections.singleton(loader.getClass().getName());
View Full Code Here


      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.useChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfig cfg : clmConfig.getCacheLoaderConfigs()) {
            if (cfg instanceof CacheStoreConfig) {
               if (((CacheStoreConfig) cfg).isFetchPersistentState()) numLoadersWithFetchPersistentState++;
               if (numLoadersWithFetchPersistentState > 1)
                  throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");
               assertNotSingletonAndShared(((CacheStoreConfig) cfg));
            }

            CacheLoader l = createCacheLoader(cfg, cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         CacheLoaderConfig cfg = clmConfig.getFirstCacheLoaderConfig();
         if (cfg != null) {
            tmpLoader = createCacheLoader(cfg, cache);
View Full Code Here

      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.useChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfig cfg : clmConfig.getCacheLoaderConfigs()) {
            if (cfg instanceof CacheStoreConfig) {
               if (((CacheStoreConfig) cfg).isFetchPersistentState()) numLoadersWithFetchPersistentState++;
               if (numLoadersWithFetchPersistentState > 1)
                  throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");
               assertNotSingletonAndShared(((CacheStoreConfig) cfg));
            }

            CacheLoader l = createCacheLoader(cfg, cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         CacheLoaderConfig cfg = clmConfig.getFirstCacheLoaderConfig();
         if (cfg != null) {
            tmpLoader = createCacheLoader(cfg, cache);
View Full Code Here

      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.useChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfig cfg : clmConfig.getCacheLoaderConfigs()) {
            if (cfg instanceof CacheStoreConfig) {
               if (((CacheStoreConfig) cfg).isFetchPersistentState()) numLoadersWithFetchPersistentState++;
               if (numLoadersWithFetchPersistentState > 1)
                  throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");
               assertNotSingletonAndShared(((CacheStoreConfig) cfg));
            }

            CacheLoader l = createCacheLoader(cfg, cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         CacheLoaderConfig cfg = clmConfig.getFirstCacheLoaderConfig();
         if (cfg != null) {
            tmpLoader = createCacheLoader(cfg, cache);
View Full Code Here

      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.useChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfig cfg : clmConfig.getCacheLoaderConfigs()) {
            if (cfg instanceof CacheStoreConfig) {
               if (((CacheStoreConfig) cfg).isFetchPersistentState()) numLoadersWithFetchPersistentState++;
               if (numLoadersWithFetchPersistentState > 1)
                  throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");
               assertNotSingletonAndShared(((CacheStoreConfig) cfg));
            }

            CacheLoader l = createCacheLoader(cfg, cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         CacheLoaderConfig cfg = clmConfig.getFirstCacheLoaderConfig();
         if (cfg != null) {
            tmpLoader = createCacheLoader(cfg, cache);
View Full Code Here

    * This method returns a collection of cache loader types (fully qualified class names) that are configured and enabled.
    */
   public Collection<String> getCacheLoaders() {
      if (enabled && clm.isEnabled()) {
         if (loader instanceof ChainingCacheStore) {
            ChainingCacheStore chainingStore = (ChainingCacheStore) loader;
            LinkedHashMap<CacheStore, StoreConfiguration> stores = chainingStore.getStores();
            Set<String> storeTypes = new HashSet<String>(stores.size());
            for (CacheStore cs : stores.keySet()) storeTypes.add(cs.getClass().getName());
            return storeTypes;
         } else {
            return Collections.singleton(loader.getClass().getName());
View Full Code Here

         ComponentRegistry cr = cache.getComponentRegistry();
         CacheLoaderInterceptor cli = cr.getComponent(CacheLoaderInterceptor.class);
         CacheStoreInterceptor csi = cr.getComponent(CacheStoreInterceptor.class);

         if (loader instanceof ChainingCacheStore) {
            ChainingCacheStore ccs = (ChainingCacheStore) loader;
            ccs.removeCacheLoader(loaderType);
            if (ccs.getStores().isEmpty()) disableInterceptors = true;
         } else {
            if (loader.getClass().getName().equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
View Full Code Here

      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.usingChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (LoaderConfiguration cfg : clmConfig.cacheLoaders()) {
            if (cfg instanceof StoreConfiguration) {
               StoreConfiguration scfg = (StoreConfiguration) cfg;
               assertNotSingletonAndShared(scfg);
               if(scfg.fetchPersistentState()) numLoadersWithFetchPersistentState++;
            }
            if (numLoadersWithFetchPersistentState > 1)
               throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         if (!clmConfig.cacheLoaders().isEmpty()) {
            LoaderConfiguration cfg = clmConfig.cacheLoaders().get(0);
            if (cfg instanceof StoreConfiguration)
View Full Code Here

      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.useChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfig cfg : clmConfig.getCacheLoaderConfigs()) {
            if (cfg instanceof CacheStoreConfig) {
               if (((CacheStoreConfig) cfg).isFetchPersistentState()) numLoadersWithFetchPersistentState++;
               if (numLoadersWithFetchPersistentState > 1)
                  throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");
               assertNotSingletonAndShared(((CacheStoreConfig) cfg));
            }

            CacheLoader l = createCacheLoader(cfg, cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         CacheLoaderConfig cfg = clmConfig.getFirstCacheLoaderConfig();
         if (cfg != null) {
            tmpLoader = createCacheLoader(cfg, cache);
View Full Code Here

      // if we only have a single cache loader configured in the chaining cacheloader then
      // don't use a chaining cache loader at all.
      // also if we are using passivation then just directly use the first cache loader.
      if (clmConfig.useChainingCacheLoader()) {
         // create chaining cache loader.
         ChainingCacheStore ccl = new ChainingCacheStore();
         tmpLoader = ccl;

         // only one cache loader may have fetchPersistentState to true.
         int numLoadersWithFetchPersistentState = 0;
         for (CacheLoaderConfig cfg : clmConfig.getCacheLoaderConfigs()) {
            if (cfg instanceof CacheStoreConfig) {
               if (((CacheStoreConfig) cfg).isFetchPersistentState()) numLoadersWithFetchPersistentState++;
               if (numLoadersWithFetchPersistentState > 1)
                  throw new Exception("Invalid cache loader configuration!!  Only ONE cache loader may have fetchPersistentState set to true.  Cache will not start!");
               assertNotSingletonAndShared(((CacheStoreConfig) cfg));
            }

            CacheLoader l = createCacheLoader(cfg, cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         CacheLoaderConfig cfg = clmConfig.getFirstCacheLoaderConfig();
         if (cfg != null) {
            tmpLoader = createCacheLoader(cfg, cache);
View Full Code Here

TOP

Related Classes of org.infinispan.loaders.decorators.ChainingCacheStore

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.