From 589901b03688e073eb85b5b51a58cec3c8d5d5e9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 7 Aug 2016 23:46:00 +0300 Subject: juick-ws: do not use servlet api directly, refactor components as InitializingBean --- .../com/juick/ws/configuration/WebsocketConfiguration.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'juick-ws/src/main/java/com/juick/ws/configuration') diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index ecd44908..92b61bc7 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -3,7 +3,6 @@ package com.juick.ws.configuration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.juick.ws.WebsocketComponent; -import com.juick.ws.XMPPConnection; import com.mitchellbosecke.pebble.PebbleEngine; import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.loader.ServletLoader; @@ -31,8 +30,6 @@ import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry import javax.inject.Inject; import javax.servlet.ServletContext; import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; /** * Created by vitalyster on 28.06.2016. @@ -44,17 +41,11 @@ import java.util.concurrent.Executors; public class WebsocketConfiguration extends WebMvcConfigurationSupport implements WebSocketConfigurer { @Inject Environment env; - ExecutorService xmppThread = Executors.newSingleThreadExecutor(); @Bean WebsocketComponent wsHandler() { return new WebsocketComponent(); } - @Bean - XMPPConnection xmpp() { - XMPPConnection xmpp = new XMPPConnection(env, wsHandler()); - xmppThread.submit(xmpp); - return xmpp; - } + @Bean JdbcTemplate jdbc() { BasicDataSource dataSource = new BasicDataSource(); -- cgit v1.2.3