diff options
author | Vitaly Takmazov | 2016-06-28 11:34:25 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-06-28 11:34:25 +0300 |
commit | a2faab09d3a8604ffe24dd337a3ab099f132e311 (patch) | |
tree | cc66a7f629579e62dea8034aecb4065c86adf6a3 /src | |
parent | f2387bcc06dca0bf3368f32a99a6ec74a7381ccd (diff) |
fix xmpp component wiring, take 2
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/ws/XMPPConnection.java | 7 | ||||
-rw-r--r-- | src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/juick/ws/XMPPConnection.java b/src/main/java/com/juick/ws/XMPPConnection.java index 5d4fbce9..802271a0 100644 --- a/src/main/java/com/juick/ws/XMPPConnection.java +++ b/src/main/java/com/juick/ws/XMPPConnection.java @@ -8,6 +8,7 @@ import com.juick.xmpp.Message; import com.juick.xmpp.Stream; import com.juick.xmpp.StreamComponent; import com.juick.xmpp.extensions.JuickMessage; +import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; import org.springframework.web.socket.TextMessage; @@ -30,14 +31,16 @@ public class XMPPConnection implements Runnable, Stream.StreamListener, Message. @Inject JdbcTemplate sql; + @Inject + Environment env; Stream xmpp; String xmppPassword; MessageSerializer ms; @Inject WebsocketComponent ws; - public XMPPConnection(String password) { - xmppPassword = password; + public XMPPConnection() { + xmppPassword = env.getProperty("xmpp_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 9fd75bb0..46ef8486 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(env.getProperty("xmpp_password")); + return new XMPPConnection(); } @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { |