From 3e783602987483bbd2ee5791020894891d39b016 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 30 Nov 2016 00:27:23 +0300 Subject: juick-ws: update to data services --- .../com/juick/ws/configuration/WebsocketConfiguration.java | 10 +++++----- .../java/com/juick/ws/configuration/WebsocketInitializer.java | 2 +- 2 files changed, 6 insertions(+), 6 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 e7f0042e..4c20001a 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 @@ -1,12 +1,13 @@ package com.juick.ws.configuration; +import com.juick.configuration.DataConfiguration; import com.juick.ws.WebsocketComponent; import com.juick.ws.XMPPConnection; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; -import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry; import org.springframework.web.socket.config.annotation.WebSocketConfigurer; @@ -21,20 +22,19 @@ import javax.inject.Inject; @Configuration @EnableWebSocket @PropertySource("classpath:juick.conf") +@Import(DataConfiguration.class) class WebsocketConfiguration implements WebSocketConfigurer { @Inject private Environment env; - @Inject - private JdbcTemplate jdbc; @Bean public WebsocketComponent wsHandler() { - return new WebsocketComponent(jdbc); + return new WebsocketComponent(); } @Bean public XMPPConnection ws() { - return new XMPPConnection(env, wsHandler(), jdbc); + return new XMPPConnection(env, wsHandler()); } @Override diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java index 751da635..a754f1a9 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java @@ -13,7 +13,7 @@ public class WebsocketInitializer extends AbstractAnnotationConfigDispatcherServ @Override protected Class[] getRootConfigClasses() { - return new Class[]{DataConfiguration.class, WebsocketConfiguration.class}; + return new Class[]{WebsocketConfiguration.class}; } @Override -- cgit v1.2.3