Examples of persistence()


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

   }

   protected EmbeddedCacheManager initializeInfinispan(File rootDir) {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder
            .persistence()
            .addStore(LuceneStoreConfigurationBuilder.class)
            .autoChunkSize(1024)
            .location(rootDir.getAbsolutePath());
      return TestCacheManagerFactory.createCacheManager(builder);
View Full Code Here

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

   }

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
      cb.persistence()
            .addStore(JdbcStringBasedStoreConfigurationBuilder.class)
            .preload(false)
            .key2StringMapper(LuceneKey2StringMapper.class)
            .table()
               .idColumnName("ID_COLUMN")
View Full Code Here

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

      //We need at least one Directory to exist on filesystem to trigger the problem
      FSDirectory luceneDirectory = FSDirectory.open(subDir);
      luceneDirectory.close();
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.persistence()
            .addStore(LuceneStoreConfigurationBuilder.class)
               .autoChunkSize(110)
               .location(rootDir.getAbsolutePath());

      return TestCacheManagerFactory.createCacheManager(builder);
View Full Code Here

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

      return TestCacheManagerFactory.createCacheManager(true);
   }

   protected AdvancedLoadWriteStore createCacheStore() {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.persistence().addStore(JpaStoreConfigurationBuilder.class)
            .persistenceUnitName(PERSISTENCE_UNIT_NAME)
            .entityClass(getEntityClass());

      JpaStore store = new JpaStore();
      store.init(new InitializationContextImpl(builder.persistence().stores().get(0).create(), cm.getCache(),
View Full Code Here

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

      builder.persistence().addStore(JpaStoreConfigurationBuilder.class)
            .persistenceUnitName(PERSISTENCE_UNIT_NAME)
            .entityClass(getEntityClass());

      JpaStore store = new JpaStore();
      store.init(new InitializationContextImpl(builder.persistence().stores().get(0).create(), cm.getCache(),
            getMarshaller(), new DefaultTimeService(), null, new MarshalledEntryFactoryImpl(getMarshaller())));
      store.start();

      assertNotNull(store.getEntityManagerFactory());
      assertTrue(store.getEntityManagerFactory() instanceof HibernateEntityManagerFactory);
View Full Code Here

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

   }

   public void testTwoCachesSameCacheStore() {
      ConfigurationBuilder cb = new ConfigurationBuilder();
      cb.read(cacheManager.getDefaultCacheConfiguration());
      createCacheStoreConfig(cb.persistence(), false);
      Configuration c = cb.build();
      cacheManager.defineConfiguration("testTwoCachesSameCacheStore-1", c);
      cacheManager.defineConfiguration("testTwoCachesSameCacheStore-2", c);

      Cache<String, Object> first = cacheManager.getCache("testTwoCachesSameCacheStore-1");
View Full Code Here

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

      assertNull(first.get("key2"));
   }

   public void testPreloadAndExpiry() {
      ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
      createCacheStoreConfig(cb.persistence(), true);
      cacheManager.defineConfiguration("testPreloadAndExpiry", cb.build());
      Cache<String, Object> cache = cacheManager.getCache("testPreloadAndExpiry");
      cache.start();

      assert cache.getCacheConfiguration().persistence().preload();
View Full Code Here

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

      assertCacheEntry(cache, "k4", "v", 333333, 444444);
   }

   public void testPreloadStoredAsBinary() {
      ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
      createCacheStoreConfig(cb.persistence(), true).storeAsBinary().enable();
      cacheManager.defineConfiguration("testPreloadStoredAsBinary", cb.build());
      Cache<String, Pojo> cache = cacheManager.getCache("testPreloadStoredAsBinary");
      cache.start();

      assert cache.getCacheConfiguration().persistence().preload();
View Full Code Here

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

      ConfigurationBuilder cfg = base == null ? new ConfigurationBuilder() : base;

      cfg
         .transaction()
            .transactionMode(TransactionMode.TRANSACTIONAL);
      createCacheStoreConfig(cfg.persistence(), false);
      cfg.persistence().stores().get(0).purgeOnStartup(purge);
      return cfg;
   }

   private void assertCacheEntry(Cache cache, String key, String value, long lifespanMillis, long maxIdleMillis) {
View Full Code Here

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

      cfg
         .transaction()
            .transactionMode(TransactionMode.TRANSACTIONAL);
      createCacheStoreConfig(cfg.persistence(), false);
      cfg.persistence().stores().get(0).purgeOnStartup(purge);
      return cfg;
   }

   private void assertCacheEntry(Cache cache, String key, String value, long lifespanMillis, long maxIdleMillis) {
      DataContainer dc = cache.getAdvancedCache().getDataContainer();
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.