From 7270411d55c154e42c942caeaf4d4b942d72dea2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 8 Nov 2016 16:36:52 +0300 Subject: ws: fix injection --- juick-xmpp/src/main/java/com/juick/components/XMPPServer.java | 4 ++-- .../java/com/juick/components/configuration/XMPPConfiguration.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'juick-xmpp/src/main/java/com/juick') diff --git a/juick-xmpp/src/main/java/com/juick/components/XMPPServer.java b/juick-xmpp/src/main/java/com/juick/components/XMPPServer.java index 31aa0bc7..a091d477 100644 --- a/juick-xmpp/src/main/java/com/juick/components/XMPPServer.java +++ b/juick-xmpp/src/main/java/com/juick/components/XMPPServer.java @@ -52,13 +52,13 @@ public class XMPPServer implements DisposableBean, Stream.StreamListener, private final List inConnections = Collections.synchronizedList(new ArrayList<>()); private final List outConnections = Collections.synchronizedList(new ArrayList<>()); private final List outCache = Collections.synchronizedList(new ArrayList<>()); - @Inject public JdbcTemplate jdbc; final public HashMap childParsers = new HashMap<>(); @Inject - public XMPPServer(Environment env, ExecutorService service) { + public XMPPServer(Environment env, ExecutorService service, JdbcTemplate jdbc) { this.service = service; + this.jdbc = jdbc; logger.info("component initialized"); try { HOSTNAME = env.getProperty("hostname"); diff --git a/juick-xmpp/src/main/java/com/juick/components/configuration/XMPPConfiguration.java b/juick-xmpp/src/main/java/com/juick/components/configuration/XMPPConfiguration.java index 1695de6a..7cada270 100644 --- a/juick-xmpp/src/main/java/com/juick/components/configuration/XMPPConfiguration.java +++ b/juick-xmpp/src/main/java/com/juick/components/configuration/XMPPConfiguration.java @@ -39,6 +39,8 @@ public class XMPPConfiguration extends WebMvcConfigurationSupport { Environment env; @Inject ExecutorService service; + @Inject + JdbcTemplate jdbc; @Bean JdbcTemplate jdbc() { @@ -78,7 +80,7 @@ public class XMPPConfiguration extends WebMvcConfigurationSupport { } @Bean public XMPPServer xmpp() { - return new XMPPServer(env, service); + return new XMPPServer(env, service, jdbc); } @Bean public ExecutorService service() { -- cgit v1.2.3