aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-18 03:47:00 +0700
committerGravatar Vitaly Takmazov2016-11-18 09:24:54 +0300
commit4679da47ffedf2a0f29c324880fa537fe9447f39 (patch)
treea40e86f6033492a977447b9696437cb894d24f9d /juick-ws/src/main
parentc260c0c4a0a8d84a7ef442eb40d5a63e9d5326dc (diff)
correct closing babble components implemented
Diffstat (limited to 'juick-ws/src/main')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/XMPPConnection.java10
1 files changed, 9 insertions, 1 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 c6ac5b50..fb510306 100644
--- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
+++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
/**
* @author ugnich
*/
-public class XMPPConnection implements InitializingBean {
+public class XMPPConnection implements InitializingBean, DisposableBean {
private static final Logger logger = LoggerFactory.getLogger(XMPPConnection.class);
private final JdbcTemplate jdbc;
@@ -90,6 +90,14 @@ public class XMPPConnection implements InitializingBean {
}
}
+ @Override
+ public void destroy() throws Exception {
+ if (xmpp != null)
+ xmpp.close();
+
+ logger.info("XmppSession on WS destroyed");
+ }
+
MessageSerializer messageSerializer = new MessageSerializer();
private void onJuickPM(final int uid_to, final com.juick.Message jmsg) {