diff options
author | Vitaly Takmazov | 2016-11-16 12:43:16 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-16 16:21:51 +0300 |
commit | a6e05ed6c2ad9d96d5d2b40a399e5c321fffb4e5 (patch) | |
tree | 660f6fd84cfaa36031bb695ee59e8abf05297ea0 | |
parent | b11a395c46aa92179a4a6019d2ebef15877b3946 (diff) |
juick-ws: threads are handled by babbler
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/XMPPConnection.java | 14 | ||||
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/configuration/WebsocketAppConfiguration.java | 7 |
2 files changed, 3 insertions, 18 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 1b6eb3dc..c6ac5b50 100644 --- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java +++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java @@ -29,11 +29,10 @@ import java.util.stream.Collectors; /** * @author ugnich */ -public class XMPPConnection implements InitializingBean, DisposableBean { +public class XMPPConnection implements InitializingBean { private static final Logger logger = LoggerFactory.getLogger(XMPPConnection.class); private final JdbcTemplate jdbc; - private final ExecutorService service; private final WebsocketComponent wsHandler; private final String xmppPassword; private final MessageSerializer ms; @@ -44,13 +43,11 @@ public class XMPPConnection implements InitializingBean, DisposableBean { public XMPPConnection( - final Environment env, final ExecutorService service, final WebsocketComponent wsHandler, final JdbcTemplate jdbc) { + final Environment env, final WebsocketComponent wsHandler, final JdbcTemplate jdbc) { Assert.notNull(env); - Assert.notNull(service); Assert.notNull(wsHandler); Assert.notNull(jdbc); - this.service = service; this.wsHandler = wsHandler; this.jdbc = jdbc; @@ -93,13 +90,6 @@ public class XMPPConnection implements InitializingBean, DisposableBean { } } - @Override - public void destroy() throws Exception { - ThreadHelper.shutdownAndAwaitTermination(service); - - logger.info("XMPPConnection destroyed"); - } - MessageSerializer messageSerializer = new MessageSerializer(); private void onJuickPM(final int uid_to, final com.juick.Message jmsg) { diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketAppConfiguration.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketAppConfiguration.java index 9e2e4f6f..9824a30c 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketAppConfiguration.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketAppConfiguration.java @@ -38,12 +38,7 @@ public class WebsocketAppConfiguration implements WebSocketConfigurer { @Bean public XMPPConnection ws() { - return new XMPPConnection(env, service(), wsHandler(), jdbc); - } - - @Bean - public ExecutorService service() { - return Executors.newCachedThreadPool(); + return new XMPPConnection(env, wsHandler(), jdbc); } @Override |