diff options
author | Vitaly Takmazov | 2018-04-12 14:17:46 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-04-12 14:17:46 +0300 |
commit | 9e5a6b3f2f6907f18f22718bcb6f0ac7f79c95cd (patch) | |
tree | 06d4eab436f56607f324cd2c43808854c35a6dfc /juick-notifications/src/main/java/com/juick/components/service | |
parent | e24f7a7ce9eb765aa2f581defbe20433a647700d (diff) |
server: MessageEvent now have list of subscribers
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/service')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java b/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java index eecddc70..0f62e702 100644 --- a/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java +++ b/juick-notifications/src/main/java/com/juick/components/service/JuickServerComponent.java @@ -1,6 +1,7 @@ package com.juick.components.service; import com.fasterxml.jackson.databind.ObjectMapper; +import com.juick.components.Notifications; import com.juick.server.component.DisconnectedEvent; import com.juick.server.component.MessageEvent; import org.slf4j.Logger; @@ -26,6 +27,8 @@ public class JuickServerComponent extends TextWebSocketHandler { @Inject private ApplicationEventPublisher applicationEventPublisher; @Inject + private Notifications notifications; + @Inject private ObjectMapper jsonMapper; private WebSocketSession session; @@ -54,7 +57,7 @@ public class JuickServerComponent extends TextWebSocketHandler { if (logger.isInfoEnabled()) // prevent writeValueAsString execution if logger disabled logger.info("got jmsg: {}", jsonMapper.writeValueAsString(jmsg)); if (!closeFlag.get()) { - applicationEventPublisher.publishEvent(new MessageEvent(this, jmsg)); + notifications.messageReceived(jmsg); } } |