aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/configuration
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/configuration')
-rw-r--r--src/main/java/com/juick/server/configuration/BaseWebConfiguration.java30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java b/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
index a05b4fc1..2e3ec33d 100644
--- a/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
+++ b/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
@@ -24,51 +24,31 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
-import org.springframework.scheduling.annotation.SchedulingConfigurer;
-import org.springframework.scheduling.config.ScheduledTaskRegistrar;
-import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter;
-import javax.annotation.Nonnull;
import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
/**
* Created by vitalyster on 28.06.2016.
*/
@Configuration
-public class BaseWebConfiguration implements WebMvcConfigurer, SchedulingConfigurer {
+public class BaseWebConfiguration implements WebMvcConfigurer {
@Value("${keystore:classpath:juick-test-key.p12}")
private Resource keystore;
@Value("${keystore_password:secret}")
private String keystorePassword;
- @Override
- public void configurePathMatch(PathMatchConfigurer configurer) {
- configurer.setUseSuffixPatternMatch(false);
- }
-
@Bean
public ResourceUrlEncodingFilter resourceUrlEncodingFilter() {
return new ResourceUrlEncodingFilter();
}
- @Override
- public void configureTasks(@Nonnull ScheduledTaskRegistrar taskRegistrar) {
- taskRegistrar.setScheduler(taskExecutor());
- }
-
- @Bean(destroyMethod="shutdown")
- public Executor taskExecutor() {
- return Executors.newScheduledThreadPool(100);
- }
-
- @Bean
- public ExecutorService executorService() {
- return Executors.newCachedThreadPool();
+ @Bean(name = "threadPoolTaskExecutor")
+ public Executor threadPoolTaskExecutor() {
+ return new ThreadPoolTaskExecutor();
}
@Bean
public KeystoreManager keystoreManager() {