org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer Java Examples

The following examples show how to use org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer. 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: CacheRedisConfig.java    From notes with Apache License 2.0 5 votes vote down vote up
@Bean
public CacheManagerCustomizer<RedisCacheManager> redisCacheManagerCustomizer() {
    return cacheManager -> {
        Map<String, Long> expires = cacheProperties.getKeyAndExpires();
        cacheManager.setCacheNames(expires.keySet());
        cacheManager.setExpires(expires);
    };
}
 
Example #2
Source File: RedisCacheManagerConfig.java    From mica with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public CacheManagerCustomizers cacheManagerCustomizers(
	ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
	return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example #3
Source File: RedisConfig.java    From spring-microservice-exam with MIT License 4 votes vote down vote up
@Bean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example #4
Source File: RedisCacheManagerConfig.java    From black-shop with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManagerCustomizers cacheManagerCustomizers(
		ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
	return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example #5
Source File: MultiCacheAutoConfig.java    From gateway-helper with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example #6
Source File: RedisCacheAutoConfiguration.java    From faster-framework-project with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example #7
Source File: MultiCacheAutoConfig.java    From api-gateway-old with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example #8
Source File: CacheConfig.java    From platform with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManagerCustomizer<CaffeineCacheManager> cacheManagerCustomizer() {
    return cacheManager -> cacheManager.setAllowNullValues(true);
}
 
Example #9
Source File: CacheConfig.java    From secrets-proxy with Apache License 2.0 2 votes vote down vote up
/**
 * Tunes the auto configured Cache manager.
 *
 * @return {@link CacheManagerCustomizer}
 */
@Bean
public CacheManagerCustomizer<CaffeineCacheManager> cacheManagerCustomizer() {
  return cacheManager -> cacheManager.setAllowNullValues(false);
}