aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-06 19:47:18 +0300
committerGravatar Vitaly Takmazov2016-07-06 19:47:18 +0300
commit7cbf108b84682fb17af15f528df3f0bd952fc58d (patch)
tree0965331b070d7b2fd850acdd4565f46f6119c8b2
parent448c3854ff3ebed5fd38193c71a2bc7b9217fe02 (diff)
refactoring
-rw-r--r--src/main/java/com/juick/xmpp/s2s/XMPPComponent.java41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java b/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
index 5cdce82a..8ebdb76a 100644
--- a/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
+++ b/src/main/java/com/juick/xmpp/s2s/XMPPComponent.java
@@ -170,23 +170,23 @@ public class XMPPComponent implements ServletContextListener {
public void contextInitialized(ServletContextEvent sce) {
LOGGER.info("component initialized");
- xmppService.submit(() -> {
- Properties conf = new Properties();
- try {
- conf.load(sce.getServletContext().getResourceAsStream("/WEB-INF/juick.conf"));
- HOSTNAME = conf.getProperty("hostname");
- String componentName = conf.getProperty("componentname");
- STATSFILE = conf.getProperty("statsfile");
- keystore = conf.getProperty("keystore");
- keystorePassword = conf.getProperty("keystore_password");
- brokenSSLhosts = Arrays.asList(conf.getProperty("broken_ssl_hosts", "").split(","));
- DriverManagerDataSource dataSource = new DriverManagerDataSource();
- dataSource.setDriverClassName(conf.getProperty("datasource_driver", "com.mysql.jdbc.Driver"));
- dataSource.setUrl(conf.getProperty("datasource_url"));
- sql = new JdbcTemplate(dataSource);
+ Properties conf = new Properties();
+ try {
+ conf.load(sce.getServletContext().getResourceAsStream("/WEB-INF/juick.conf"));
+ HOSTNAME = conf.getProperty("hostname");
+ String componentName = conf.getProperty("componentname");
+ STATSFILE = conf.getProperty("statsfile");
+ keystore = conf.getProperty("keystore");
+ keystorePassword = conf.getProperty("keystore_password");
+ brokenSSLhosts = Arrays.asList(conf.getProperty("broken_ssl_hosts", "").split(","));
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(conf.getProperty("datasource_driver", "com.mysql.jdbc.Driver"));
+ dataSource.setUrl(conf.getProperty("datasource_url"));
+ sql = new JdbcTemplate(dataSource);
- childParsers.put(JuickMessage.XMLNS, new JuickMessage());
- executorService.submit(() -> connRouter = new ConnectionRouter(this, componentName, conf.getProperty("xmpp_password")));
+ childParsers.put(JuickMessage.XMLNS, new JuickMessage());
+ xmppService.submit(() -> {
+ connRouter = new ConnectionRouter(this, componentName, conf.getProperty("xmpp_password"));
executorService.submit(new CleaningUp(this));
final ServerSocket listener = new ServerSocket(5269);
LOGGER.info("s2s listener ready");
@@ -200,10 +200,11 @@ public class XMPPComponent implements ServletContextListener {
LOGGER.log(Level.SEVERE, "s2s error", e);
}
}
- } catch (Exception e) {
- LOGGER.log(Level.SEVERE, "XMPPComponent error", e);
- }
- });
+ });
+
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, "XMPPComponent error", e);
+ }
}