aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-03-02 11:03:57 +0300
committerGravatar Vitaly Takmazov2020-03-02 11:03:57 +0300
commit06e420b3905ed27aea311c4811a84aba5106d325 (patch)
treedbaf5df70f766c83472cad3d39fb021a5d67f705 /src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
parent4b99b789121453cfc131718b72eafbf0e6d8a7fe (diff)
Simplify configuration
Diffstat (limited to 'src/main/java/com/juick/server/configuration/BaseWebConfiguration.java')
-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() {