aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-12-11 13:12:03 +0700
committerGravatar Vitaly Takmazov2016-12-11 18:24:38 +0300
commit2e4b161d61e811240d41ab44771f68acd3e2ab42 (patch)
tree793590e320a9801827eb9fd59ab893ae923b7b5c /juick-spring-www/src/main
parent2243cb78fe142cfe8f55d0f6a76c3cfdb1cd2835 (diff)
merge configuration
Diffstat (limited to 'juick-spring-www/src/main')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WebAppConfiguration.java14
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WwwHelpConfiguration.java25
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/configuration/WwwInitializer.java3
3 files changed, 15 insertions, 27 deletions
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