Search in sources :

Example 1 with FeatureStoreEhCache

use of org.ff4j.store.FeatureStoreEhCache in project ff4j by ff4j.

the class FeatureStoreTerracottaTestIT method initStore.

/**
 * {@inheritDoc}
 */
@Override
protected FeatureStore initStore() {
    // Configuration to wirk with Terracotta
    Configuration managerConfiguration = new Configuration();
    managerConfiguration.name("config").terracotta(new TerracottaClientConfiguration().url(TERRACOTTA_URL)).defaultCache(new CacheConfiguration().maxBytesLocalHeap(128, MemoryUnit.MEGABYTES).terracotta(new TerracottaConfiguration())).cache(new CacheConfiguration().name(FF4jEhCacheWrapper.CACHENAME_FEATURES).maxBytesLocalHeap(128, MemoryUnit.MEGABYTES).terracotta(new TerracottaConfiguration()));
    FeatureStoreEhCache ehcacheStore = new FeatureStoreEhCache(managerConfiguration);
    ehcacheStore.importFeaturesFromXmlFile("ff4j.xml");
    return ehcacheStore;
}
Also used : TerracottaClientConfiguration(net.sf.ehcache.config.TerracottaClientConfiguration) CacheConfiguration(net.sf.ehcache.config.CacheConfiguration) TerracottaConfiguration(net.sf.ehcache.config.TerracottaConfiguration) Configuration(net.sf.ehcache.config.Configuration) TerracottaClientConfiguration(net.sf.ehcache.config.TerracottaClientConfiguration) TerracottaConfiguration(net.sf.ehcache.config.TerracottaConfiguration) FeatureStoreEhCache(org.ff4j.store.FeatureStoreEhCache) CacheConfiguration(net.sf.ehcache.config.CacheConfiguration)

Aggregations

CacheConfiguration (net.sf.ehcache.config.CacheConfiguration)1 Configuration (net.sf.ehcache.config.Configuration)1 TerracottaClientConfiguration (net.sf.ehcache.config.TerracottaClientConfiguration)1 TerracottaConfiguration (net.sf.ehcache.config.TerracottaConfiguration)1 FeatureStoreEhCache (org.ff4j.store.FeatureStoreEhCache)1