Package org.infinispan.manager

Examples of org.infinispan.manager.EmbeddedCacheManager.stop()


      EmbeddedCacheManager cacheManager = createClusteredCacheManager();
      cacheManager.defineConfiguration("cache1", getIndexedConfig().build());
      cacheManager.defineConfiguration("cache2", getIndexedConfigWithCustomCaches("lockCache", "metadataCache", "dataCache").build());
      startAndIndexData("cache1", cacheManager);
      startAndIndexData("cache2", cacheManager);
      cacheManager.stop();

      assertEquals(cacheManager.getStatus(), ComponentStatus.TERMINATED);
   }

   @Test
View Full Code Here


   @Test
   public void testIndexingWithInfinispanIndexManager() {
      EmbeddedCacheManager cacheManager = createClusteredCacheManager();
      cacheManager.defineConfiguration("cache", getIndexedConfigWithInfinispanIndexManager().build());
      startAndIndexData("cache", cacheManager);
      cacheManager.stop();

      assertEquals(cacheManager.getStatus(), ComponentStatus.TERMINATED);
   }

View Full Code Here

         Cache<Object, Object> cache = embeddedCacheManager.getCache("Indexed");
         cache = cache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES);
         writeStuff(cache);
      }
      finally {
         embeddedCacheManager.stop();
      }
   }

   /**
    * We write a lot of elements.. and run a Query occasionally to check.
View Full Code Here

      try {
         Cache cache3 = cm.getCache(CACHE_NAME);
         cache1.put(k(m), o);
         assertEquals(o, cache3.get(k(m)));
      } finally {
         cm.stop();
      }
   }

   private EmbeddedCacheManager createCacheManager() {
      GlobalConfiguration globalCfg = GlobalConfiguration.getClusteredDefault();
View Full Code Here

   }

   public void testStopStartCM() throws Exception {
      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager(false);
      cacheContainers.add(cm);
      cm.stop();
      cm.start();
   }

   public void testRegisterLocalCache() throws Exception {
      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager(false);
View Full Code Here

         // write initial data
         cache1.put("A", new DelayedUnmarshal());
         cache1.put("B", new DelayedUnmarshal());
         cache1.put("C", new DelayedUnmarshal());
         assertEquals(cache1.size(), 3);
         cm1.stop();

         // this cache is only used to start networking
         final ConfigurationBuilder defaultConfigurationBuilder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true);

         // now lets start cm and shortly after another cache manager
View Full Code Here

      for (int i =0; i < 1024 * 300; i++) {
         cache.put(i,i);
      }
      System.out.println("Free meme after: " + freeMemKb());
      System.out.println("Consumed memory: " + (freeMemBefore - freeMemKb()));
      cm.stop();
      for (int i = 0; i<10; i++) {
         System.gc();
         if (isOkay(freeMemBefore)) {
            break;
         } else {
View Full Code Here

         AdvancedCache advancedCache = cacheManager.getCache().getAdvancedCache();
         String name = m.getName();
         advancedCache.put("k-" + name, "v-" + name);
         advancedCache.withFlags(Flag.SKIP_LOCKING).put("k-" + name, "v2-" + name);
      } finally {
         cacheManager.stop();
      }
   }

}
View Full Code Here

         }
      }
     
      EmbeddedCacheManager container = entry.getContainer();
      container.removeListener(entry);
      container.stop();
   }
  
   private void bind(String jndiName, Object value) throws NamingException
   {
      Context context = new InitialContext();
View Full Code Here

         printCacheContents(cache);
      }

      stop = true;
      putThread.join();
      cacheManager.stop();
      System.exit(0);
   }

   /**
    * {@link org.infinispan.Cache#entrySet()}
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.