aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/configuration
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-08-08 11:01:02 +0300
committerGravatar Vitaly Takmazov2016-08-08 11:02:26 +0300
commit930b3f29f788d7866d66fcb9e946f5947782d968 (patch)
tree5a710a4598deaf74c432cdcc775b45572fa933e7 /juick-ws/src/main/java/com/juick/ws/configuration
parent64824ed6dddf776ce3ed36fe96ffc300d4127e29 (diff)
juick-ws: components as async beans
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.java36
1 files changed, 36 insertions, 0 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 92b61bc7..086ae4ce 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
@@ -3,6 +3,10 @@ package com.juick.ws.configuration;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.juick.ws.WebsocketComponent;
+import com.juick.ws.XMPPConnection;
+import com.juick.ws.components.CrosspostComponent;
+import com.juick.ws.components.PushComponent;
+import com.juick.ws.components.XMPPComponent;
import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.loader.Loader;
import com.mitchellbosecke.pebble.loader.ServletLoader;
@@ -41,6 +45,14 @@ import java.util.List;
public class WebsocketConfiguration extends WebMvcConfigurationSupport implements WebSocketConfigurer {
@Inject
Environment env;
+ @Inject
+ XMPPComponent ws;
+ @Inject
+ CrosspostComponent crosspost;
+ @Inject
+ PushComponent push;
+ @Inject
+ XMPPConnection xmpp;
@Bean
WebsocketComponent wsHandler() {
return new WebsocketComponent();
@@ -82,6 +94,30 @@ public class WebsocketConfiguration extends WebMvcConfigurationSupport implement
viewResolver.setPebbleEngine(pebbleEngine());
return viewResolver;
}
+ @Bean
+ public XMPPConnection ws() {
+ XMPPConnection ws = new XMPPConnection();
+ ws.init();
+ return ws;
+ }
+ @Bean
+ public XMPPComponent xmpp() {
+ XMPPComponent xmpp = new XMPPComponent();
+ xmpp.init();
+ return xmpp;
+ }
+ @Bean
+ public CrosspostComponent crosspost() {
+ CrosspostComponent crosspost = new CrosspostComponent();
+ crosspost.init();
+ return crosspost;
+ }
+ @Bean
+ public PushComponent push() {
+ PushComponent push = new PushComponent();
+ push.init();
+ return push;
+ }
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping() {