Search in sources :

Example 1 with SimpleCacheManager

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

the class CacheTestUtils method createSimpleCacheManager.

/**
 * Create a {@link SimpleCacheManager} with the specified cache(s).
 *
 * @param cacheNames the names of the caches to create
 */
public 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)

Example 2 with SimpleCacheManager

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

the class CacheTestUtils method createSimpleCacheManager.

/**
 * Create a {@link SimpleCacheManager} with the specified cache(s).
 * @param cacheNames the names of the caches to create
 */
public 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)

Example 3 with SimpleCacheManager

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

the class CacheTestUtils method createSimpleCacheManager.

/**
 * Create a {@link SimpleCacheManager} with the specified cache(s).
 *
 * @param cacheNames the names of the caches to create
 */
public 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)

Example 4 with SimpleCacheManager

use of cn.taketoday.cache.support.SimpleCacheManager in project today-framework 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)

Example 5 with SimpleCacheManager

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

the class CacheTestUtils method createSimpleCacheManager.

/**
 * Create a {@link SimpleCacheManager} with the specified cache(s).
 * @param cacheNames the names of the caches to create
 */
public 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