Package org.infinispan.configuration.cache

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


      assert store.table().timestampColumnType().equals("BIGINT");
      assert store.fetchPersistentState();
      assert store.async().enabled();

      b = new ConfigurationBuilder();
      b.persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class).read(store);
      Configuration configuration2 = b.build();
      JdbcStringBasedStoreConfiguration store2 = (JdbcStringBasedStoreConfiguration) configuration2.persistence().stores().get(0);
      assert store2.connectionFactory() instanceof PooledConnectionFactoryConfiguration;
      assert ((PooledConnectionFactoryConfiguration)store2.connectionFactory()).connectionUrl().equals(JDBC_URL);
      assert store2.table().tableNamePrefix().equals("STRINGS_");
View Full Code Here


   }

   static ConfigurationBuilder createCacheStoreConfig(String mapperName, boolean wrap, boolean preload) {
      ConfigurationBuilder cfg = TestCacheManagerFactory.getDefaultCacheConfiguration(false);

      JdbcStringBasedStoreConfigurationBuilder store = cfg
         .persistence()
            .addStore(JdbcStringBasedStoreConfigurationBuilder.class)
               .fetchPersistentState(true)
               .preload(preload)
               .key2StringMapper(mapperName);
View Full Code Here

      verifyFullTextHasMatches(0);
   }

   private void recreateCacheManager() {
      ConfigurationBuilder cfg = new ConfigurationBuilder();
      cfg.persistence()
            .passivation(true)
            .addStore(DummyInMemoryStoreConfigurationBuilder.class)
            .preload(true)
            .purgeOnStartup(true)
         .indexing()
View Full Code Here

       });
    }

    private EmbeddedCacheManager getCacheManager(boolean batchingEnabled) throws Exception {
       ConfigurationBuilder builder = new ConfigurationBuilder();
       builder
          .persistence()
             .passivation(false)
          .addSingleFileStore()
             .location(TMP_DIR + File.separator + "cacheStore")
             .preload(false)
View Full Code Here

   }

   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

   }

   @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

      //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

      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

      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

   }

   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

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.