From 1c3d94825fdf7f899dcad372ab7bc538a79df971 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 1 Aug 2016 13:43:30 +0300 Subject: Utils.parseInt -> apache-lang3's NumberUtils --- juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-ws/src/main/java/com/juick/ws') 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 4e2f6d57..b737b5d9 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 @@ -10,6 +10,7 @@ import com.juick.xmpp.extensions.Nickname; import com.juick.xmpp.extensions.XOOB; import com.juick.ws.s2s.*; import org.apache.commons.dbcp2.BasicDataSource; +import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.core.JdbcTemplate; import org.xmlpull.v1.XmlPullParserException; @@ -179,6 +180,7 @@ public class XMPPComponent implements ServletContextListener, Stream.StreamListe conf.load(sce.getServletContext().getResourceAsStream("/WEB-INF/juick.conf")); HOSTNAME = conf.getProperty("hostname"); componentName = conf.getProperty("componentname"); + int componentPort = NumberUtils.toInt(conf.getProperty("component_port"), 5347); JID Jid = new JID(conf.getProperty("xmppbot_jid")); STATSFILE = conf.getProperty("statsfile"); keystore = conf.getProperty("keystore"); @@ -196,7 +198,7 @@ public class XMPPComponent implements ServletContextListener, Stream.StreamListe executorService.submit(() -> { Socket routerSocket = null; try { - routerSocket = new Socket("localhost", 5347); + routerSocket = new Socket("localhost", componentPort); setRouter(new StreamComponent(new JID("s2s"), routerSocket.getInputStream(), routerSocket.getOutputStream(), conf.getProperty("xmpp_password"))); getRouter().addChildParser(new JuickMessage()); getRouter().addListener((Stream.StreamListener) this); -- cgit v1.2.3