Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.invocationBatching()


   CacheLoader loader;

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder c = getDefaultStandaloneCacheConfig(true);
      c
         .invocationBatching().enable()
         .persistence()
            .passivation(true)
            .addStore(DummyInMemoryStoreConfigurationBuilder.class);
      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(c);
View Full Code Here


      return TestCacheManagerFactory.createCacheManager(builder);
   }

   protected ConfigurationBuilder buildConfiguration() {
      ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
      builder.invocationBatching().enable();
      builder.transaction().lockingMode(LockingMode.OPTIMISTIC);
      return builder;
   }

   public void testAtomicMapWithoutTransactionManagerLookupSet() {
View Full Code Here

      assert AtomicMapLookup.getAtomicMap(ahmCache, "key").get("a").equals("b");
   }

   public void testAtomicMapWithoutBatchSet() {
      ConfigurationBuilder builder = buildConfiguration();
      builder.invocationBatching().disable();
      cacheManager.defineConfiguration("ahm_without_batch", builder.build());
      Cache<String, String> ahmCache = cacheManager.getCache("ahm_without_batch");

      AtomicMap<String, String> map = AtomicMapLookup.getAtomicMap(ahmCache, "key");
      assert map.isEmpty();
View Full Code Here

   }

   @Test(expectedExceptions = IllegalStateException.class)
   public void testAtomicMapNonTransactionWithoutBatchSet() {
      ConfigurationBuilder builder = buildConfiguration();
      builder.invocationBatching().disable();
      builder.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
      cacheManager.defineConfiguration("ahm_no_tx_without_batch", builder.build());
      Cache<String, String> ahmCache = cacheManager.getCache("ahm_no_tx_without_batch");

      AtomicMap<String, String> map = AtomicMapLookup.getAtomicMap(ahmCache, "key");
View Full Code Here

      assert AtomicMapLookup.getFineGrainedAtomicMap(fgahmCache, "key").get("a").equals("b");
   }

   public void testFineGrainedAtomicMapWithoutBatchSet() {
      ConfigurationBuilder builder = buildConfiguration();
      builder.invocationBatching().disable();
      cacheManager.defineConfiguration("fgahm_without_batch", builder.build());
      Cache<String, String> fgahmCache = cacheManager.getCache("fgahm_without_batch");

      FineGrainedAtomicMap<String, String> map = AtomicMapLookup.getFineGrainedAtomicMap(fgahmCache, "key");
      assert map.isEmpty();
View Full Code Here

   }

   @Test(expectedExceptions = IllegalStateException.class)
   public void testFineGrainedAtomicMapNonTransactionWithoutBatchSet() {
      ConfigurationBuilder builder = buildConfiguration();
      builder.invocationBatching().disable();
      builder.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
      cacheManager.defineConfiguration("fgahm_no_tx_without_batch", builder.build());
      Cache<String, String> fgahmCache = cacheManager.getCache("fgahm_no_tx_without_batch");

      FineGrainedAtomicMap<String, String> map = AtomicMapLookup.getFineGrainedAtomicMap(fgahmCache, "key");
View Full Code Here

   private CacheContainer cacheContainer;

   @BeforeTest
   public void setUp() {
      ConfigurationBuilder c = new ConfigurationBuilder();
      c.invocationBatching().enable();
      cacheContainer = TestCacheManagerFactory.createCacheManager(c);
      cache = cacheContainer.getCache();
      tm = TestingUtil.getTransactionManager(cache);
   }
View Full Code Here

      // default cache with no overrides
      Cache c = cm.getCache();

      ConfigurationBuilder overrides = new ConfigurationBuilder();
      overrides.invocationBatching().enable();
      cm.defineConfiguration("overridden", overrides.build());
      Cache overridden = cm.getCache("overridden");

      // assert components.
      assert !TestingUtil.extractComponent(c, InterceptorChain.class).containsInterceptorType(BatchingInterceptor.class);
View Full Code Here

   public void testGetCacheConfigurationAfterDefiningSameOldConfigurationTwice() {
      withCacheManager(new CacheManagerCallable(createCacheManager(false)) {
         @Override
         public void call() {
            ConfigurationBuilder c = new ConfigurationBuilder();
            c.invocationBatching().enable(false);
            Configuration newConfig = cm.defineConfiguration("new-cache", c.build());
            assert !newConfig.invocationBatching().enabled();

            c = new ConfigurationBuilder();
            c.invocationBatching().enable();
View Full Code Here

            c.invocationBatching().enable(false);
            Configuration newConfig = cm.defineConfiguration("new-cache", c.build());
            assert !newConfig.invocationBatching().enabled();

            c = new ConfigurationBuilder();
            c.invocationBatching().enable();
            Configuration newConfig2 = cm.defineConfiguration("new-cache", c.build());
            assert newConfig2.invocationBatching().enabled();
            assert cm.getCache("new-cache").getCacheConfiguration().invocationBatching().enabled();
         }
      });
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.