From 1d520f4d1bcfd78c21b7b542619cc828ff64dcb7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 6 Feb 2018 13:02:06 +0300 Subject: web: trying to defer service connections --- .../main/java/com/juick/api/configuration/ApiAppConfiguration.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'juick-api/src') diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java index 828f8cbd..388fda67 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java @@ -21,10 +21,7 @@ import com.juick.api.ApiServer; import com.juick.server.component.JuickServerComponent; import com.juick.server.component.JuickServerReconnectManager; import com.juick.server.configuration.BaseWebConfiguration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; +import org.springframework.context.annotation.*; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @@ -47,10 +44,12 @@ import java.util.Collections; @PropertySource("classpath:juick.conf") @ComponentScan(basePackages = "com.juick") public class ApiAppConfiguration extends BaseWebConfiguration { + @Lazy @Bean public JuickServerComponent juickServerComponent() { return new JuickServerComponent(); } + @Lazy @Bean public JuickServerReconnectManager juickServerReconnectManager() { return new JuickServerReconnectManager(); -- cgit v1.2.3