From 2e4b161d61e811240d41ab44771f68acd3e2ab42 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Sun, 11 Dec 2016 13:12:03 +0700 Subject: merge configuration --- .../www/configuration/WebAppConfiguration.java | 14 ++++++++++++ .../www/configuration/WwwHelpConfiguration.java | 25 ---------------------- .../juick/www/configuration/WwwInitializer.java | 3 +-- 3 files changed, 15 insertions(+), 27 deletions(-) delete mode 100644 juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java (limited to 'juick-spring-www/src/main/java') diff --git a/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java index c9ecfeac..b314db64 100644 --- a/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java +++ b/juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java @@ -1,7 +1,10 @@ package com.juick.www.configuration; +import com.juick.www.HelpService; import com.juick.www.WebApp; import com.juick.www.settings.TemplateSettingsHolder; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.guava.GuavaCacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @@ -15,6 +18,7 @@ import javax.annotation.Resource; */ @Configuration @PropertySource("classpath:juick.conf") +@EnableCaching public class WebAppConfiguration { @Resource private Environment env; @@ -40,4 +44,14 @@ public class WebAppConfiguration { public WebApp webApp() { return new WebApp(env); } + + @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/WwwHelpConfiguration.java b/juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java deleted file mode 100644 index d3b1aa9b..00000000 --- a/juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java +++ /dev/null @@ -1,25 +0,0 @@ -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 c8c162bd..edb9a9fc 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 @@ -20,8 +20,7 @@ public class WwwInitializer extends AbstractAnnotationConfigDispatcherServletIni WebAppConfiguration.class, DataConfiguration.class, SearchConfiguration.class, - WebSecurityConfig.class, - WwwHelpConfiguration.class}; + WebSecurityConfig.class}; } @Override -- cgit v1.2.3