Search in sources :

Example 1 with Cache

use of org.qi4j.spi.cache.Cache in project qi4j-sdk by Qi4j.

the class EhCachePoolMixin method createNewCache.

private <T> EhCacheImpl<T> createNewCache(String cacheId, Class<T> valueType) {
    CacheConfiguration cc = createCacheConfiguration(cacheId);
    // TODO: We also need all the other Configurations that are possible, like cacheLoaderFactoryConfiguration
    net.sf.ehcache.Cache cache = new net.sf.ehcache.Cache(cc);
    cacheManager.addCache(cache);
    return new EhCacheImpl<>(cacheId, cache, valueType);
}
Also used : CacheConfiguration(net.sf.ehcache.config.CacheConfiguration) Cache(org.qi4j.spi.cache.Cache)

Aggregations

CacheConfiguration (net.sf.ehcache.config.CacheConfiguration)1 Cache (org.qi4j.spi.cache.Cache)1