Package org.infinispan

Examples of org.infinispan.Cache.stop()


         }
      }

      if (defaultCache != null) {
         unregisterCacheMBean(defaultCache);
         defaultCache.stop();
      }
      globalComponentRegistry.getComponent(CacheManagerJmxRegistration.class).stop();
      globalComponentRegistry.stop();
   }
View Full Code Here


                     defaultCache = entry.getValue().cache;
                  } else {
                     Cache c = entry.getValue().cache;
                     if (c != null) {
                        unregisterCacheMBean(c);
                        c.stop();
                     }
                  }
               }

               if (defaultCache != null) {
View Full Code Here

   @Test(expectedExceptions = IllegalStateException.class)
   public void testEnsureProperCacheState() throws Exception {
      ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true);
      EmbeddedCacheManager cacheManager = addClusterEnabledCacheManager(builder);
      Cache cache = cacheManager.getCache();
      cache.stop();

      try {
         MapReduceTask<String, String, String, Integer> task = createMapReduceTask(cache);
      } catch(IllegalStateException ex) {
         assertNotNull(ex.getMessage());
View Full Code Here

   @Test(expectedExceptions = IllegalStateException.class)
   public void testCacheStopFollowedByGetCache() {
      Cache cache = cacheManager.getCache();
      cache.put("k", "v");
      cache.stop();
      Cache cache2 = cacheManager.getCache();
      cache2.put("k", "v2");
   }

   @Test(expectedExceptions = IllegalStateException.class)
View Full Code Here

   @Test(expectedExceptions = IllegalStateException.class)
   public void testCacheStopFollowedByCacheOp() {
      Cache cache = cacheManager.getCache("big");
      cache.put("k", "v");
      cache.stop();
      cache.put("k", "v2");
   }

}
View Full Code Here

            assertInCacheAndStore(preloadingCache, preloadingStore, "k" + i, "v" + i, lifespan);
      }

      DataContainer c = preloadingCache.getAdvancedCache().getDataContainer();
      assert c.size() == 4;
      preloadingCache.stop();
      assert c.size() == 0;

      preloadingCache.start();
      // The old store's marshaller is not working any more
      preloadingStore = TestingUtil.extractComponent(preloadingCache, CacheLoaderManager.class).getCacheStore();
View Full Code Here

            assertInCacheAndStore(purgingCache, purgingStore, "k" + i, "v" + i, lifespan);
      }

      DataContainer c = purgingCache.getAdvancedCache().getDataContainer();
      assert c.size() == 4;
      purgingCache.stop();
      assert c.size() == 0;

      purgingCache.start();
      c = purgingCache.getAdvancedCache().getDataContainer();
      assert c.size() == 0;
View Full Code Here

               return null;
            }
         };
         callStoppingCacheFuture = executorService.submit(callStoppingCache);
      }
      cache.stop(); // now stop the cache
      latch.countDown(); // now that cache has been stopped, let the thread continue

      log.debug("All threads finished, let's shutdown the executor and check whether any exceptions were reported");
      waitAfterModFuture.get();
      if (callStoppingCacheFuture != null) {
View Full Code Here

      ) {
         @Override
         public void call() {
            try {
               Cache cache = cm.getCache();
               cache.stop();

               MapReduceTask<String, String, String, Integer> task = createMapReduceTask(cache);
            } catch(IllegalStateException ex) {
               assertNotNull(ex.getMessage());
               assertTrue(ex.getMessage().contains("Cache is in an invalid state:"));
View Full Code Here

                     defaultCache = entry.getValue().cache;
                  } else {
                     Cache c = entry.getValue().cache;
                     if (c != null) {
                        unregisterCacheMBean(c);
                        c.stop();
                     }
                  }
               }

               if (defaultCache != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.