diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick/api')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/ApiServer.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/juick-api/src/main/java/com/juick/api/ApiServer.java b/juick-api/src/main/java/com/juick/api/ApiServer.java index d7862952..d5324319 100644 --- a/juick-api/src/main/java/com/juick/api/ApiServer.java +++ b/juick-api/src/main/java/com/juick/api/ApiServer.java @@ -22,13 +22,8 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.ApplicationListener; -import org.springframework.context.support.AbstractApplicationContext; -import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.socket.client.WebSocketConnectionManager; -import org.springframework.web.socket.client.standard.StandardWebSocketClient; import rocks.xmpp.addr.Jid; import rocks.xmpp.core.XmppException; import rocks.xmpp.core.session.Extension; @@ -41,7 +36,6 @@ import rocks.xmpp.extensions.oob.model.x.OobX; import javax.annotation.Nonnull; import javax.annotation.PostConstruct; import javax.inject.Inject; -import javax.servlet.ServletContext; import java.net.URI; import java.net.URISyntaxException; @@ -64,7 +58,7 @@ public class ApiServer implements ApplicationListener<DisconnectedEvent>, AutoCl @Value("${xmpp_disabled:false}") private boolean isXmppDisabled; @Inject - private ServletContext servletContext; + private WebSocketConnectionManager webSocketConnectionManager; @PostConstruct public void init() { @@ -123,7 +117,7 @@ public class ApiServer implements ApplicationListener<DisconnectedEvent>, AutoCl @Override public void onApplicationEvent(@Nonnull DisconnectedEvent event) { logger.info("reloading app..."); - WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext); - ((AbstractApplicationContext) context).refresh(); + webSocketConnectionManager.stop(); + webSocketConnectionManager.start(); } } |