Spring Framework SimpleCacheManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SimpleCacheManager class.

This code example shows how to use the following methods:setCaches
@ComponentScan(basePackages = { "ch.rasc.caching.guava" }) 
public class Config { 
 
	@Bean 
	public CacheManager cacheManager() {
		SimpleCacheManager cacheManager = new SimpleCacheManager();
 
		Cache<Object, Object> oneMinuteCache = CacheBuilder.newBuilder()
				.expireAfterWrite(1, TimeUnit.MINUTES).build();
 
		Cache<Object, Object> maxSizeCache = CacheBuilder.newBuilder().maximumSize(10)
				.build();
 
		cacheManager.setCaches(Arrays.asList(new GuavaCache("oneMinuteCache",
				oneMinuteCache), new GuavaCache("maxSizeCache", maxSizeCache)));
 
		return cacheManager;
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:setCaches
		SpringApplication.run(Application.class, args);
	} 
 
	@Bean 
	public CacheManager cacheManager() {
		SimpleCacheManager cacheManager = new SimpleCacheManager();
 
		Cache<Object, Object> tenMinutesCache = CacheBuilder.newBuilder()
				.expireAfterWrite(10, TimeUnit.MINUTES).build();
 
		Cache<Object, Object> maxSizeCache = CacheBuilder.newBuilder().maximumSize(10)
				.build();
 
		cacheManager.setCaches(Arrays.asList(new GuavaCache("tenMinutesCache",
				tenMinutesCache), new GuavaCache("maxSizeCache", maxSizeCache)));
 
		return cacheManager;
	} 
 
	@Bean 
5
CodeRank
This code example shows how to use the following methods:setCaches
This code example shows how to use the following methods:setCaches
        */ 
    } 
 
    @Bean 
    public CacheManager cacheManager() throws Exception {
        SimpleCacheManager scm = new SimpleCacheManager();
        Cache cache = new ConcurrentMapCache("customers");
        scm.setCaches(Arrays.asList(cache));
        return scm;
    } 
 
    public Map<String, String> contributeSessionFactoryProperties() {
        Map<String, String> p = new HashMap<String, String>();
        p.put(org.hibernate.cfg.Environment.HBM2DDL_AUTO, "create");
        p.put(org.hibernate.cfg.Environment.HBM2DDL_IMPORT_FILES , "import_h2.sql");
        p.put(org.hibernate.cfg.Environment.DIALECT, H2Dialect.class.getName());
        p.put(org.hibernate.cfg.Environment.SHOW_SQL, "true");
        return p;
    } 
} 
4
CodeRank
This code example shows how to use the following methods:setCaches
            .build(); 
    } 
 
    @Bean 
    public CacheManager cacheManager() throws Exception { 
        SimpleCacheManager scm = new SimpleCacheManager(); 
        Cache cache = new ConcurrentMapCache("customers"); 
        scm.setCaches(Arrays.asList(cache)); 
        return scm; 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:setCaches
This code example shows how to use the following methods:setCaches
public class CacheConfiguration implements CachingConfigurer {
 
    @Override 
    @Bean 
    public CacheManager cacheManager() {
        SimpleCacheManager cacheManager = new SimpleCacheManager();
        cacheManager.setCaches(Arrays.asList(new ConcurrentMapCache("streams")));
        return cacheManager;
    } 
 
    @Override 
    @Bean 
    public KeyGenerator keyGenerator() {
        return new SimpleKeyGenerator();
    } 
 
} 
5
CodeRank
See Code Examples for Spring Framework SimpleCacheManager Methods: