Package org.springframework.cache.support

Examples of org.springframework.cache.support.SimpleCacheManager


            .build();
    }

    @Bean
    public CacheManager cacheManager() throws Exception {
        SimpleCacheManager scm = new SimpleCacheManager();
        Cache cache = new ConcurrentMapCache("customers");
        scm.setCaches(Arrays.asList(cache));
        return scm;
    }
View Full Code Here


    @Bean
    public CacheManager cacheManager(@Value(CachedRestClient.CACHE_TTL) Long cacheNetworkTimeToLive,
                                     @Value(DatabaseConfig.CACHE_TTL) Long cacheDatabaseTimeToLive,
                                     @Value(GettingStartedGuides.CACHE_TTL) Long cacheGuideTimeToLive) {
        SimpleCacheManager cacheManager = new SimpleCacheManager();

        List<ConcurrentMapCache> cacheList = new ArrayList<>();
        cacheList.add(createConcurrentMapCache(cacheNetworkTimeToLive, CachedRestClient.CACHE_NAME, -1));
        cacheList.add(createConcurrentMapCache(cacheDatabaseTimeToLive, DatabaseConfig.CACHE_NAME, 50));
        cacheList.add(createConcurrentMapCache(cacheGuideTimeToLive, GettingStartedGuides.CACHE_NAME, 100));
        cacheManager.setCaches(cacheList);
        return cacheManager;
    }
View Full Code Here

      return new DummyFooRepository();
    }

    @Bean
    public CacheManager cacheManager() {
      SimpleCacheManager mgr = new SimpleCacheManager();
      ArrayList<Cache> caches = new ArrayList<Cache>();
      caches.add(new ConcurrentMapCache(""));
      mgr.setCaches(caches);
      return mgr;
    }
View Full Code Here

  /**
   * 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<Cache>();
    for (String cacheName : cacheNames) {
      caches.add(new ConcurrentMapCache(cacheName));
    }
    result.setCaches(caches);
    result.afterPropertiesSet();
    return result;
  }
View Full Code Here

  @EnableCaching
  public static class Spr11592Config {

    @Bean
    public CacheManager cacheManager() {
      SimpleCacheManager cacheManager = new SimpleCacheManager();
      cacheManager.setCaches(Arrays.asList(cache()));
      return cacheManager;
    }
View Full Code Here

      return new SimpleService();
    }

    @Bean
    public CacheManager cacheManager() {
      SimpleCacheManager cacheManager = new SimpleCacheManager();
      cacheManager.setCaches(Arrays.asList(mockCache()));
      return cacheManager;
    }
View Full Code Here

  protected final CacheResolver defaultExceptionCacheResolver = new SimpleExceptionCacheResolver(cacheManager);

  protected final KeyGenerator defaultKeyGenerator = new SimpleKeyGenerator();

  protected static CacheManager createSimpleCacheManager(String... cacheNames) {
    SimpleCacheManager result = new SimpleCacheManager();
    List<Cache> caches = new ArrayList<Cache>();
    for (String cacheName : cacheNames) {
      caches.add(new ConcurrentMapCache(cacheName));
    }
    result.setCaches(caches);
    result.afterPropertiesSet();
    return result;
  }
View Full Code Here

  @EnableCaching(mode = AdviceMode.ASPECTJ)
  public static class EnableCachingConfig {

    @Bean
    public CacheManager cacheManager() {
      SimpleCacheManager cm = new SimpleCacheManager();
      cm.setCaches(Arrays.asList(
          defaultCache(),
          new ConcurrentMapCache("primary"),
          new ConcurrentMapCache("secondary"),
          new ConcurrentMapCache("exception")));
      return cm;
View Full Code Here

  @EnableCaching
  public static class EnableCachingConfig {

    @Bean
    public CacheManager cacheManager() {
      SimpleCacheManager cm = new SimpleCacheManager();
      cm.setCaches(Arrays.asList(
          defaultCache(),
          new ConcurrentMapCache("primary"),
          new ConcurrentMapCache("secondary"),
          new ConcurrentMapCache("exception")));
      return cm;
View Full Code Here

  @EnableCaching
  static class EnableCachingConfig {

    @Bean
    public CacheManager cacheManager() {
      SimpleCacheManager cm = new SimpleCacheManager();
      cm.setCaches(Arrays.asList(
          defaultCache(),
          exceptionCache()));
      return cm;
    }
View Full Code Here

TOP

Related Classes of org.springframework.cache.support.SimpleCacheManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.