diff options
author | Vitaly Takmazov | 2016-08-01 13:43:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-08-01 13:43:30 +0300 |
commit | 1c3d94825fdf7f899dcad372ab7bc538a79df971 (patch) | |
tree | 7cf2b9173e8050e9425e12be2c16941e044a019a /juick-ws/src/main/java/com/juick/ws/components | |
parent | a85973603a137a2866bb434e4276844425d3cb77 (diff) |
Utils.parseInt -> apache-lang3's NumberUtils
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/components')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java | 4 |
1 files changed, 3 insertions, 1 deletions
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); |