Class MetricBroadcaster


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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSession​(org.eclipse.jetty.websocket.api.Session session)
      Add a session to the session list.
      void broadcast​(byte[] bytes)
      Send binary frame to each WebSocket session.
      void broadcast​(java.lang.String text)
      Send text frame to each WebSocket session.
      static MetricBroadcaster getInstance()
      Getter for the singleton object.
      void removeSession​(org.eclipse.jetty.websocket.api.Session session)
      Remove a session from the session list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(java.lang.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.