diff options
Diffstat (limited to 'juick-ws/src/main')
5 files changed, 12 insertions, 16 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java index a9bab3274..24041eebd 100644 --- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java +++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java @@ -33,14 +33,13 @@ public class XMPPConnection implements JuickComponent, Stream.StreamListener, Me private static final Logger logger = Logger.getLogger(XMPPConnection.class.getName()); @Inject JdbcTemplate sql; - @Inject - Environment env; Stream xmpp; String xmppPassword; MessageSerializer ms; WebsocketComponent wsHandler; - public XMPPConnection() { + @Inject + public XMPPConnection(Environment env) { xmppPassword = env.getProperty("xmpp_password"); ms = new MessageSerializer(); try { diff --git a/juick-ws/src/main/java/com/juick/ws/components/CrosspostComponent.java b/juick-ws/src/main/java/com/juick/ws/components/CrosspostComponent.java index 289e9809a..8cda122e7 100644 --- a/juick-ws/src/main/java/com/juick/ws/components/CrosspostComponent.java +++ b/juick-ws/src/main/java/com/juick/ws/components/CrosspostComponent.java @@ -63,10 +63,9 @@ public class CrosspostComponent implements JuickComponent, DisposableBean, Strea Stream xmpp; String twitter_consumer_key; String twitter_consumer_secret; - @Inject - Environment env; - public CrosspostComponent() { + @Inject + public CrosspostComponent(Environment env) { logger.info("component initialized"); try { twitter_consumer_key = env.getProperty("twitter_consumer_key", ""); diff --git a/juick-ws/src/main/java/com/juick/ws/components/PushComponent.java b/juick-ws/src/main/java/com/juick/ws/components/PushComponent.java index b219d9d79..fb26b935d 100644 --- a/juick-ws/src/main/java/com/juick/ws/components/PushComponent.java +++ b/juick-ws/src/main/java/com/juick/ws/components/PushComponent.java @@ -79,10 +79,9 @@ public class PushComponent implements JuickComponent, DisposableBean, Stream.Str Socket socket; Stream xmpp; Sender GCMSender; - @Inject - Environment env; - public PushComponent() { + @Inject + public PushComponent(Environment env) { logger.info("component initialized"); wns_application_sip = env.getProperty("wns_application_sip", ""); wns_client_secret = env.getProperty("wns_client_secret", ""); diff --git a/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java b/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java index fb67e5a2f..6ce2482d9 100644 --- a/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java +++ b/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java @@ -59,10 +59,9 @@ public class XMPPComponent implements JuickComponent, DisposableBean, Stream.Str private final List<CacheEntry> outCache = Collections.synchronizedList(new ArrayList<>()); private JdbcTemplate sql; final public HashMap<String, StanzaChild> childParsers = new HashMap<>(); - @Inject - Environment env; - public XMPPComponent() { + @Inject + public XMPPComponent(Environment env) { logger.info("component initialized"); try { HOSTNAME = env.getProperty("hostname"); 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 086ae4cea..495a3c91f 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 @@ -96,25 +96,25 @@ public class WebsocketConfiguration extends WebMvcConfigurationSupport implement } @Bean public XMPPConnection ws() { - XMPPConnection ws = new XMPPConnection(); + XMPPConnection ws = new XMPPConnection(env); ws.init(); return ws; } @Bean public XMPPComponent xmpp() { - XMPPComponent xmpp = new XMPPComponent(); + XMPPComponent xmpp = new XMPPComponent(env); xmpp.init(); return xmpp; } @Bean public CrosspostComponent crosspost() { - CrosspostComponent crosspost = new CrosspostComponent(); + CrosspostComponent crosspost = new CrosspostComponent(env); crosspost.init(); return crosspost; } @Bean public PushComponent push() { - PushComponent push = new PushComponent(); + PushComponent push = new PushComponent(env); push.init(); return push; } |