diff options
author | Alexander Alexeev | 2016-12-11 04:41:47 +0700 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-11 18:24:37 +0300 |
commit | 2243cb78fe142cfe8f55d0f6a76c3cfdb1cd2835 (patch) | |
tree | 9ad1b1bacb2a86bd9a4f7fb3a9591ec28088b090 /juick-spring-www/src/main/java/com/juick/www/configuration | |
parent | a7f9acc91fa51489e8b1ac02e90b29ef497b08c1 (diff) |
caching help
Diffstat (limited to 'juick-spring-www/src/main/java/com/juick/www/configuration')
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java | 25 | ||||
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java | 6 |
2 files changed, 30 insertions, 1 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java new file mode 100644 index 00000000..d3b1aa9b --- /dev/null +++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java @@ -0,0 +1,25 @@ +package com.juick.www.configuration; + +import com.juick.www.HelpService; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.guava.GuavaCacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Created by aalexeev on 12/11/16. + */ +@Configuration +@EnableCaching +public class WwwHelpConfiguration { + + @Bean + public GuavaCacheManager cacheManager() { + return new GuavaCacheManager("help"); + } + + @Bean + public HelpService helpService() { + return new HelpService("help"); + } +} diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java index e62b1042..c8c162bd 100644 --- a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java +++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java @@ -17,7 +17,11 @@ public class WwwInitializer extends AbstractAnnotationConfigDispatcherServletIni @Override protected Class<?>[] getRootConfigClasses() { return new Class<?>[]{ - WebAppConfiguration.class, DataConfiguration.class, SearchConfiguration.class, WebSecurityConfig.class}; + WebAppConfiguration.class, + DataConfiguration.class, + SearchConfiguration.class, + WebSecurityConfig.class, + WwwHelpConfiguration.class}; } @Override |