diff options
Diffstat (limited to 'juick-ws/src/main/java/com')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/XMPPConnection.java | 11 |
1 files changed, 2 insertions, 9 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 fb510306..30dad3f3 100644 --- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java +++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java @@ -4,12 +4,9 @@ import com.juick.User; import com.juick.json.MessageSerializer; import com.juick.server.MessagesQueries; import com.juick.server.SubscriptionsQueries; -import com.juick.util.ThreadHelper; import org.apache.commons.lang3.math.NumberUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.util.Assert; @@ -23,13 +20,12 @@ import rocks.xmpp.extensions.component.accept.ExternalComponent; import java.io.IOException; import java.util.List; -import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; /** * @author ugnich */ -public class XMPPConnection implements InitializingBean, DisposableBean { +public class XMPPConnection implements AutoCloseable { private static final Logger logger = LoggerFactory.getLogger(XMPPConnection.class); private final JdbcTemplate jdbc; @@ -56,10 +52,7 @@ public class XMPPConnection implements InitializingBean, DisposableBean { wsJid = env.getProperty("ws_jid", "ws.juick.local"); ms = new MessageSerializer(); - } - @Override - public void afterPropertiesSet() { XmppSessionConfiguration configuration = XmppSessionConfiguration.builder() .extensions(Extension.of(com.juick.Message.class)) .build(); @@ -91,7 +84,7 @@ public class XMPPConnection implements InitializingBean, DisposableBean { } @Override - public void destroy() throws Exception { + public void close() throws Exception { if (xmpp != null) xmpp.close(); |