Java Code Examples for org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers#customize()

The following examples show how to use org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers#customize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedisCacheAutoConfiguration.java    From faster-framework-project with Apache License 2.0 6 votes vote down vote up
/**
 * 管理缓存
 *
 * @return
 */
@Bean
public CacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory,
                                      RedisGenericCacheProcessor redisGenericCacheProcessor,
                                      ObjectMapper objectMapper,
                                      CacheProperties cacheProperties,
                                      CacheManagerCustomizers customizerInvoker,
                                      ResourceLoader resourceLoader
) {

    RedisGenericCacheManager redisGenericCacheManager = new RedisGenericCacheManager(RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory),
            determineConfiguration(resourceLoader.getClassLoader(), cacheProperties));
    redisGenericCacheManager.setCacheProperties(cacheProperties);
    redisGenericCacheManager.setGenericCacheMap(redisGenericCacheProcessor.getGenericCacheMap());
    redisGenericCacheManager.setObjectMapper(objectMapper);
    return customizerInvoker.customize(redisGenericCacheManager);
}
 
Example 2
Source File: MultiCacheAutoConfig.java    From gateway-helper with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(L2CacheManager.class)
public L2CacheManager cacheManager(RedisConnectionFactory connectionFactory,
                                   CacheManagerCustomizers customizerInvoker) {
    return customizerInvoker.customize(new RedisL2CacheManager(connectionFactory));
}
 
Example 3
Source File: MultiCacheAutoConfig.java    From api-gateway-old with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(L2CacheManager.class)
public L2CacheManager cacheManager(RedisConnectionFactory connectionFactory,
                                   CacheManagerCustomizers customizerInvoker) {
    return customizerInvoker.customize(new RedisL2CacheManager(connectionFactory));
}