diff options
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 |