use of net.sf.ehcache.config.CacheConfiguration in project ff4j by ff4j.
the class EhCacheCacheProviderTest method initCacheProvider.
@Test
public void initCacheProvider() {
Configuration managerConfiguration = new Configuration();
managerConfiguration.name("config");
managerConfiguration.setDefaultCacheConfiguration(new CacheConfiguration("toto", 1000));
FeatureCacheProviderEhCache fcec = new FeatureCacheProviderEhCache(managerConfiguration);
Assert.assertNotNull(fcec.getCacheProviderName());
fcec.setCacheFeatures(fcec.getCacheFeatures());
fcec.setCacheProperties(fcec.getCacheProperties());
fcec.setCacheConfiguration(fcec.getCacheConfiguration());
fcec.setCacheManager(fcec.getCacheManager());
}
use of net.sf.ehcache.config.CacheConfiguration in project joynr by bmwcarit.
the class DomainAccessControlStoreEhCache method createDrtCache.
private Cache createDrtCache() {
// configure cache as searchable
CacheConfiguration cacheConfig = new CacheConfiguration(CacheId.DOMAIN_ROLES.getIdAsString(), 0).eternal(true);
Searchable searchable = new Searchable();
cacheConfig.addSearchable(searchable);
// register searchable attributes
searchable.addSearchAttribute(new SearchAttribute().name(UserRoleKey.USER_ID));
searchable.addSearchAttribute(new SearchAttribute().name(UserRoleKey.ROLE));
cacheManager.addCache(new Cache(cacheConfig));
return cacheManager.getCache(CacheId.DOMAIN_ROLES.getIdAsString());
}
use of net.sf.ehcache.config.CacheConfiguration in project BroadleafCommerce by BroadleafCommerce.
the class BigMemoryHydratedCacheManagerImpl method getHeap.
private synchronized Cache getHeap() {
if (offHeap == null) {
if (CacheManager.getInstance().cacheExists("hydrated-offheap-cache")) {
offHeap = CacheManager.getInstance().getCache("hydrated-offheap-cache");
} else {
CacheConfiguration config = new CacheConfiguration("hydrated-offheap-cache", 500).eternal(true).overflowToOffHeap(true).maxMemoryOffHeap("1400M");
Cache cache = new Cache(config);
CacheManager.create().addCache(cache);
offHeap = cache;
}
}
return offHeap;
}
use of net.sf.ehcache.config.CacheConfiguration in project BroadleafCommerce by BroadleafCommerce.
the class EhcacheHydratedCacheManagerImpl method getHeap.
private synchronized Cache getHeap() {
if (heap == null) {
if (CacheManager.getInstance().cacheExists("hydrated-cache")) {
heap = CacheManager.getInstance().getCache("hydrated-cache");
} else {
CacheConfiguration config = new CacheConfiguration("hydrated-cache", 0).eternal(true).overflowToDisk(false).maxElementsInMemory(100000);
Cache cache = new Cache(config);
CacheManager.create().addCache(cache);
heap = cache;
}
}
return heap;
}
use of net.sf.ehcache.config.CacheConfiguration in project cloudbreak by hortonworks.
the class AwsCachingConfig method cacheConfiguration.
@Override
public CacheConfiguration cacheConfiguration() {
CacheConfiguration cacheConfiguration = new CacheConfiguration();
cacheConfiguration.setMaxEntriesLocalHeap(MAX_ENTRIES);
cacheConfiguration.setName(TEMPORARY_AWS_CREDENTIAL_CACHE);
cacheConfiguration.setTimeToLiveSeconds(TTL_IN_SECONDS);
return cacheConfiguration;
}
Aggregations