Examples of defineConfiguration()


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

   }

   protected EmbeddedCacheManager createCacheManager() {
      EmbeddedCacheManager cm = addClusterEnabledCacheManager();
      cm.defineConfiguration(TX_CACHE, buildConfiguration(true));
      cm.defineConfiguration(NONTX_CACHE, buildConfiguration(true));
      return cm;
   }

   protected void writeInitialData(final Cache<Object, Object> c) {
      c.put(A_B_NAME, JOE);
View Full Code Here

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

                                                               GlobalConfigurationBuilder gcb, ConfigurationBuilder builder, TransportFlags flags) {
         List<Cache<K, V>> caches = new ArrayList<Cache<K, V>>(numMembersInCluster);
         for (int i = 0; i < numMembersInCluster; i++) {
            EmbeddedCacheManager cm = addClusterEnabledCacheManager(flags, gcb, builder, siteName);
            if (cacheName != null)
               cm.defineConfiguration(cacheName, builder.build());

            Cache<K, V> cache = (Cache<K, V>) (cacheName == null ? cm.getCache() : cm.getCache(cacheName));

            caches.add(cache);
         }
View Full Code Here

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

   protected <K, V> List<Cache<K, V>> createClusteredCaches(
         int numMembersInCluster, String cacheName, Configuration c, TransportFlags flags) {
      List<Cache<K, V>> caches = new ArrayList<Cache<K, V>>(numMembersInCluster);
      for (int i = 0; i < numMembersInCluster; i++) {
         EmbeddedCacheManager cm = addClusterEnabledCacheManager(flags);
         cm.defineConfiguration(cacheName, c);
         Cache<K, V> cache = cm.getCache(cacheName);
         caches.add(cache);
      }
      waitForClusterToForm(cacheName);
      return caches;
View Full Code Here

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

   protected <K, V> List<Cache<K, V>> createClusteredCaches(
         int numMembersInCluster, String cacheName, ConfigurationBuilder builder, TransportFlags flags) {
      List<Cache<K, V>> caches = new ArrayList<Cache<K, V>>(numMembersInCluster);
      for (int i = 0; i < numMembersInCluster; i++) {
         EmbeddedCacheManager cm = addClusterEnabledCacheManager(flags);
         cm.defineConfiguration(cacheName, builder.build());
         Cache<K, V> cache = cm.getCache(cacheName);
         caches.add(cache);
      }
      waitForClusterToForm(cacheName);
      return caches;
View Full Code Here

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

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      // start a single cache instance
      Configuration c = getDefaultStandaloneConfig(false);
      EmbeddedCacheManager cm = TestCacheManagerFactory.createLocalCacheManager(false);
      cm.defineConfiguration("test", c);
      cache = cm.getCache("test");
      return cm;
   }

   public void testConvenienceMethods() {
View Full Code Here

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

   private EmbeddedCacheManager createCacheManager() {
      GlobalConfiguration globalCfg = GlobalConfiguration.getClusteredDefault();
      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(globalCfg);
      Configuration cfg = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC);
      cm.defineConfiguration(CACHE_NAME, cfg);
      return cm;
   }
}
View Full Code Here

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

   @Override
   protected void createCacheManagers() throws Throwable {
      Configuration cfg = createConfiguration(1);
      EmbeddedCacheManager cm = addClusterEnabledCacheManager();
      cm.defineConfiguration("onlyFetchPersistent", cfg);
   }

   private Configuration createConfiguration(int id) {
      Configuration cfg = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC, true);
      cfg.fluent().clustering().stateRetrieval().fetchInMemoryState(false);
View Full Code Here

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

      assert !cache1.getConfiguration().isFetchInMemoryState();
      cache1.put("k-" + m.getName(), "v-" + m.getName());

      Configuration cfg2 = createConfiguration(2);
      EmbeddedCacheManager cm2 = addClusterEnabledCacheManager();
      cm2.defineConfiguration("onlyFetchPersistent", cfg2);

      Cache cache2 = cache(1, "onlyFetchPersistent");
      assert !cache2.getConfiguration().isFetchInMemoryState();
      assert cache2.containsKey("k-" + m.getName());
      assert cache2.get("k-" + m.getName()).equals("v-" + m.getName());
View Full Code Here

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

      EmbeddedCacheManager localCacheManager = TestCacheManagerFactory.createLocalCacheManager(false);
      try {
         CacheLoaderManagerConfig clmConfig = new CacheLoaderManagerConfig();
         clmConfig.addCacheLoader(csConfig);
         localCacheManager.getDefaultConfiguration().setCacheLoaderManagerConfig(clmConfig);
         localCacheManager.defineConfiguration("first", new Configuration());
         localCacheManager.defineConfiguration("second", new Configuration());
         cacheNames.add("first");
         cacheNames.add("second");

         Cache first = localCacheManager.getCache("first");
View Full Code Here

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

      try {
         CacheLoaderManagerConfig clmConfig = new CacheLoaderManagerConfig();
         clmConfig.addCacheLoader(csConfig);
         localCacheManager.getDefaultConfiguration().setCacheLoaderManagerConfig(clmConfig);
         localCacheManager.defineConfiguration("first", new Configuration());
         localCacheManager.defineConfiguration("second", new Configuration());
         cacheNames.add("first");
         cacheNames.add("second");

         Cache first = localCacheManager.getCache("first");
         Cache second = localCacheManager.getCache("second");
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.