diff options
author | 2017-10-16 01:04:24 +0300 | |
---|---|---|
committer | 2017-10-16 01:10:34 +0300 | |
commit | 9b5db8da41d5c4c5f50012c0055b4008191cdb8f (patch) | |
tree | 7389f6dd71b5a60d98cb18437c00f8c9436421ab /juick-ws/src/main/java/com/juick/ws/configuration | |
parent | 52d1d04cc129d6df7b54bd41e882e353add0e4ce (diff) |
ws: fix xmpp initialization
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/configuration')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java | 9 | ||||
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index d1a6296a..c99d7a6d 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -20,6 +20,7 @@ package com.juick.ws.configuration; import com.juick.server.configuration.BaseWebConfiguration; import com.juick.server.protocol.JuickProtocol; import com.juick.ws.WebsocketComponent; +import com.juick.ws.XMPPConnection; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -31,6 +32,9 @@ import org.springframework.web.socket.config.annotation.WebSocketConfigurer; import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean; +import javax.annotation.Resource; +import javax.inject.Inject; + /** * Created by aalexeev on 11/24/16. */ @@ -40,7 +44,10 @@ import org.springframework.web.socket.server.standard.ServletServerContainerFact @EnableWebSocket @PropertySource("classpath:juick.conf") class WebsocketConfiguration extends BaseWebConfiguration implements WebSocketConfigurer { - + @Bean + public XMPPConnection xmpp() { + return new XMPPConnection(); + } @Bean public WebsocketComponent wsHandler() { return new WebsocketComponent(); diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java index c79ea924..aca3cd47 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java @@ -30,12 +30,12 @@ public class WebsocketInitializer extends AbstractAnnotationConfigDispatcherServ @Override protected Class<?>[] getRootConfigClasses() { - return new Class<?>[]{ }; + return new Class<?>[]{ WebsocketConfiguration.class }; } @Override protected Class<?>[] getServletConfigClasses() { - return new Class<?>[]{ WebsocketConfiguration.class }; + return null; } @Override |