diff options
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 |