From f2387bcc06dca0bf3368f32a99a6ec74a7381ccd Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 28 Jun 2016 11:23:34 +0300 Subject: fix xmpp component wiring --- src/main/java/com/juick/ws/XMPPConnection.java | 5 ++--- src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/juick/ws/XMPPConnection.java b/src/main/java/com/juick/ws/XMPPConnection.java index 9ed3d0cd..5d4fbce9 100644 --- a/src/main/java/com/juick/ws/XMPPConnection.java +++ b/src/main/java/com/juick/ws/XMPPConnection.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; public class XMPPConnection implements Runnable, Stream.StreamListener, Message.MessageListener { private static final Logger logger = Logger.getLogger(XMPPConnection.class.getName()); + @Inject JdbcTemplate sql; Stream xmpp; String xmppPassword; @@ -35,9 +36,7 @@ public class XMPPConnection implements Runnable, Stream.StreamListener, Message. @Inject WebsocketComponent ws; - @Inject - public XMPPConnection(JdbcTemplate sql, String password) { - this.sql = sql; + public XMPPConnection(String password) { xmppPassword = password; ms = new MessageSerializer(); new Thread(this).start(); diff --git a/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index a298d0a0..9fd75bb0 100644 --- a/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -43,7 +43,7 @@ public class WebsocketConfiguration extends WebMvcConfigurerAdapter implements W } @Bean XMPPConnection xmpp() { - return new XMPPConnection(jdbc(), env.getProperty("xmpp_password")); + return new XMPPConnection(env.getProperty("xmpp_password")); } @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { -- cgit v1.2.3