aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/configuration
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-10-24 14:06:17 +0300
committerGravatar Vitaly Takmazov2016-10-24 14:19:10 +0300
commit95ac207e5dd5566490571fda7229b754a2bbe7ac (patch)
tree44ab7bdd2b86f7abf343599162fd43846544de7a /juick-ws/src/main/java/com/juick/ws/configuration
parent44806446ccb0fc845ab289b545e5a8bcb55925dc (diff)
ws: fix injections
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.java29
1 files changed, 11 insertions, 18 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 3b75028e..a05457fa 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
@@ -34,6 +34,8 @@ import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry
import javax.inject.Inject;
import javax.servlet.ServletContext;
import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
/**
* Created by vitalyster on 28.06.2016.
@@ -46,13 +48,7 @@ public class WebsocketConfiguration extends WebMvcConfigurationSupport implement
@Inject
Environment env;
@Inject
- XMPPComponent ws;
- @Inject
- CrosspostComponent crosspost;
- @Inject
- PushComponent push;
- @Inject
- XMPPConnection xmpp;
+ ExecutorService service;
@Bean
WebsocketComponent wsHandler() {
return new WebsocketComponent();
@@ -96,26 +92,23 @@ public class WebsocketConfiguration extends WebMvcConfigurationSupport implement
}
@Bean
public XMPPConnection ws() {
- XMPPConnection ws = new XMPPConnection(env);
- ws.init();
- return ws;
+ return new XMPPConnection(env, service);
}
@Bean
public XMPPComponent xmpp() {
- XMPPComponent xmpp = new XMPPComponent(env);
- return xmpp;
+ return new XMPPComponent(env, service);
}
@Bean
public CrosspostComponent crosspost() {
- CrosspostComponent crosspost = new CrosspostComponent(env);
- crosspost.init();
- return crosspost;
+ return new CrosspostComponent(env, service);
}
@Bean
public PushComponent push() {
- PushComponent push = new PushComponent(env);
- push.init();
- return push;
+ return new PushComponent(env, service);
+ }
+ @Bean
+ public ExecutorService service() {
+ return Executors.newCachedThreadPool();
}
@Override