diff options
Diffstat (limited to 'juick-ws/src/main/java/com')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/XMPPConnection.java | 10 |
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) { |