From 9e5a6b3f2f6907f18f22718bcb6f0ac7f79c95cd Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Apr 2018 14:17:46 +0300 Subject: server: MessageEvent now have list of subscribers --- .../main/java/com/juick/components/service/JuickServerComponent.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'juick-notifications/src/main/java/com/juick/components/service') 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); } } -- cgit v1.2.3