Search in sources :

Example 6 with SimpleCacheManager

use of cn.taketoday.cache.support.SimpleCacheManager in project today-infrastructure by TAKETODAY.

the class AbstractJCacheTests method createSimpleCacheManager.

protected static CacheManager createSimpleCacheManager(String... cacheNames) {
    SimpleCacheManager result = new SimpleCacheManager();
    List<Cache> caches = new ArrayList<>();
    for (String cacheName : cacheNames) {
        caches.add(new ConcurrentMapCache(cacheName));
    }
    result.setCaches(caches);
    result.afterPropertiesSet();
    return result;
}
Also used : ConcurrentMapCache(cn.taketoday.cache.concurrent.ConcurrentMapCache) ArrayList(java.util.ArrayList) SimpleCacheManager(cn.taketoday.cache.support.SimpleCacheManager) ConcurrentMapCache(cn.taketoday.cache.concurrent.ConcurrentMapCache) Cache(cn.taketoday.cache.Cache)

Aggregations

Cache (cn.taketoday.cache.Cache)6 ConcurrentMapCache (cn.taketoday.cache.concurrent.ConcurrentMapCache)6 SimpleCacheManager (cn.taketoday.cache.support.SimpleCacheManager)6 ArrayList (java.util.ArrayList)6