aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/XMPPConnection.java')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/XMPPConnection.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
index 77a95159..a9bab327 100644
--- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
+++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
@@ -10,7 +10,6 @@ import com.juick.xmpp.Stream;
import com.juick.xmpp.StreamComponent;
import com.juick.xmpp.extensions.JuickMessage;
import org.apache.commons.lang3.math.NumberUtils;
-import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.env.Environment;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Async;
@@ -41,9 +40,7 @@ public class XMPPConnection implements JuickComponent, Stream.StreamListener, Me
MessageSerializer ms;
WebsocketComponent wsHandler;
- @Async
- @Override
- public void init() {
+ public XMPPConnection() {
xmppPassword = env.getProperty("xmpp_password");
ms = new MessageSerializer();
try {
@@ -52,12 +49,17 @@ public class XMPPConnection implements JuickComponent, Stream.StreamListener, Me
xmpp.addChildParser(new JuickMessage());
xmpp.addListener((Stream.StreamListener) this);
xmpp.addListener((Message.MessageListener) this);
- xmpp.startParsing();
} catch (IOException e) {
logger.log(Level.SEVERE, "XMPPConnection error", e);
}
}
+ @Async
+ @Override
+ public void init() {
+ xmpp.startParsing();
+ }
+
@Override
public void onStreamReady() {
logger.info("XMPP stream ready");