From 3c9afdc138bd120e8396aacadb2da2d55e462f8a Mon Sep 17 00:00:00 2001 From: Stephane Nicoll <snicoll@pivotal.io> Date: Tue, 10 Jul 2018 08:55:27 +0200 Subject: [PATCH] Polish --- ...acheConfig.java => CacheConfiguration.java} | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename src/main/java/org/springframework/samples/petclinic/system/{CacheConfig.java => CacheConfiguration.java} (50%) diff --git a/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java b/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java similarity index 50% rename from src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java rename to src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java index ff71d5c..e4d7b42 100755 --- a/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java +++ b/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java @@ -1,27 +1,27 @@ package org.springframework.samples.petclinic.system; -import javax.cache.configuration.Configuration; import javax.cache.configuration.MutableConfiguration; import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; -@org.springframework.context.annotation.Configuration +@Configuration @EnableCaching -class CacheConfig { +class CacheConfiguration { @Bean - public JCacheManagerCustomizer cacheManagerCustomizer() { + public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() { return cm -> { - Configuration<Object, Object> cacheConfiguration = createCacheConfiguration(); - cm.createCache("vets", cacheConfiguration); + cm.createCache("vets", cacheConfiguration()); }; } - private Configuration<Object, Object> createCacheConfiguration() { - // Create a cache using infinite heap. A real application will want to use an - // implementation dependent configuration that will better fit your needs + private javax.cache.configuration.Configuration<Object, Object> cacheConfiguration() { + // Create a cache using infinite heap. A real application will want to use a more fine-grained configuration, + // possibly using an implementation-dependent API return new MutableConfiguration<>().setStatisticsEnabled(true); } + } -- GitLab