Class MetricBroadcaster


  • public final class MetricBroadcaster
    extends Object
    MetricBroadcaster broadcast metric changes to the currently active WebSocket sessions.
    • Method Detail

      • getInstance

        public static MetricBroadcaster getInstance()
        Getter for the singleton object.
        Returns:
        MetricBroadcaster object.
      • addSession

        public void addSession​(org.eclipse.jetty.websocket.api.Session session)
        Add a session to the session list.
        Parameters:
        session - a WebSocket session.
      • removeSession

        public void removeSession​(org.eclipse.jetty.websocket.api.Session session)
        Remove a session from the session list.
        Parameters:
        session - a WebSocket session.
      • broadcast

        public void broadcast​(String text)
        Send text frame to each WebSocket session.
        Parameters:
        text - text to send.
      • broadcast

        public void broadcast​(byte[] bytes)
        Send binary frame to each WebSocket session.
        Parameters:
        bytes - byte array to send.