aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-16 17:24:59 +0300
committerGravatar Vitaly Takmazov2018-03-16 17:24:59 +0300
commit714614963bb5d6706124da0186cb59a8e11825a2 (patch)
tree261c404890c24907307e6160fa97f9043481230d
parent5bf87fded01c550eddc7605eee8ffbc6771dc5fb (diff)
boot: fix configurations
-rw-r--r--juick-common/src/main/java/com/juick/server/component/JuickServerComponent.java2
-rw-r--r--juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java2
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java14
3 files changed, 6 insertions, 12 deletions
diff --git a/juick-common/src/main/java/com/juick/server/component/JuickServerComponent.java b/juick-common/src/main/java/com/juick/server/component/JuickServerComponent.java
index 792f446f..dba1f480 100644
--- a/juick-common/src/main/java/com/juick/server/component/JuickServerComponent.java
+++ b/juick-common/src/main/java/com/juick/server/component/JuickServerComponent.java
@@ -5,6 +5,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.PingMessage;
import org.springframework.web.socket.TextMessage;
@@ -17,6 +18,7 @@ import javax.inject.Inject;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
+@Component
public class JuickServerComponent extends TextWebSocketHandler {
private static Logger logger = LoggerFactory.getLogger(JuickServerComponent.class);
@Inject
diff --git a/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java b/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
index d9b842af..ac9eb224 100644
--- a/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
+++ b/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java
@@ -94,7 +94,7 @@ public class BaseWebConfiguration implements WebMvcConfigurer, SchedulingConfigu
private String hostname;
@Bean
- public ExecutorService service() {
+ public ExecutorService executorService() {
return Executors.newCachedThreadPool();
}
@Bean
diff --git a/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java b/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java
index c92aaa21..6c4cac8b 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java
@@ -70,21 +70,13 @@ public class ApiAppConfiguration implements WebMvcConfigurer, WebSocketConfigure
private String serviceUser;
@Value("${websocket_url:ws://localhost:8080/ws/}")
private String baseUri;
- @Lazy
- @Bean
- public JuickServerComponent juickServerComponent() {
- return new JuickServerComponent();
- }
- @Lazy
- @Bean
- public JuickServerReconnectManager juickServerReconnectManager() {
- return new JuickServerReconnectManager();
- }
+ @Inject
+ public JuickServerComponent juickServerComponent;
@Bean
public WebSocketConnectionManager connectionManager() {
String websocketURI = UriComponentsBuilder.fromUriString(baseUri)
.queryParam("hash", userService.getHashByUID(userService.getUIDbyName(serviceUser))).build().toUriString();
- return new WebSocketConnectionManager(client(), juickServerComponent(), websocketURI);
+ return new WebSocketConnectionManager(client(), juickServerComponent, websocketURI);
}
@Bean
public StandardWebSocketClient client() {