Class SessionManager

  • All Implemented Interfaces:
    org.springframework.web.socket.WebSocketHandler

    @Component
    public class SessionManager
    extends org.springframework.web.socket.handler.TextWebSocketHandler
    Keeps track all WebSocket sessions.
    Author:
    joe
    • Constructor Detail

      • SessionManager

        public SessionManager()
    • Method Detail

      • handleTextMessage

        public void handleTextMessage​(org.springframework.web.socket.WebSocketSession session,
                                      org.springframework.web.socket.TextMessage message)
        Overrides:
        handleTextMessage in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      • afterConnectionEstablished

        public void afterConnectionEstablished​(org.springframework.web.socket.WebSocketSession session)
        Specified by:
        afterConnectionEstablished in interface org.springframework.web.socket.WebSocketHandler
        Overrides:
        afterConnectionEstablished in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      • afterConnectionClosed

        public void afterConnectionClosed​(org.springframework.web.socket.WebSocketSession session,
                                          org.springframework.web.socket.CloseStatus status)
        Specified by:
        afterConnectionClosed in interface org.springframework.web.socket.WebSocketHandler
        Overrides:
        afterConnectionClosed in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      • getClient

        public Client getClient​(Long id)
      • cleanup

        @PreDestroy
        public void cleanup()