Package org.infinispan.interceptors

Examples of org.infinispan.interceptors.CacheStoreInterceptor


   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here


   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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 {
            String loaderClassName = undelegateCacheLoader(loader).getClass().getName();
            if (loaderClassName.equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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 {
            String loaderClassName = undelegateCacheLoader(loader).getClass().getName();
            if (loaderClassName.equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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 {
            String loaderClassName = undelegateCacheLoader(loader).getClass().getName();
            if (loaderClassName.equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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 {
            String loaderClassName = undelegateCacheLoader(loader).getClass().getName();
            if (loaderClassName.equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

      cache.put("k1", "v1");
     
      // ensure that the implicit transaction created for the "put" is cleaned up from the
      // CacheStoreInterceptor "preparingTxs" and "txStores" maps
      for (int i = 0; i < getCacheManagers().size(); i++) {
         CacheStoreInterceptor cacheStoreInterceptor = getCacheStoreInterceptor(i);
         assertTxFieldsEmpty(cacheStoreInterceptor, i);
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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 {
            String loaderClassName = undelegateCacheLoader(loader).getClass().getName();
            if (loaderClassName.equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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 {
            String loaderClassName = undelegateCacheLoader(loader).getClass().getName();
            if (loaderClassName.equals(loaderType)) {
               try {
                  log.debugf("Stopping and removing cache loader %s", loaderType);
                  loader.stop();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

   public void disableCacheStore(String loaderType) {
      if (isEnabled()) {
         boolean disableInterceptors = false;
         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();
               } catch (Exception e) {
                  log.infof("Problems shutting down cache loader %s", loaderType, e);
               }
               disableInterceptors = true;
            }
         }

         if (disableInterceptors) {
            cli.disableInterceptor();
            csi.disableInterceptor();
            cache.removeInterceptor(cli.getClass());
            cache.removeInterceptor(csi.getClass());
            clmConfig = null;
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.interceptors.CacheStoreInterceptor

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.