org.springframework.web.socket.handler

Class AbstractWebSocketHandler

  • java.lang.Object
    • org.springframework.web.socket.handler.AbstractWebSocketHandler
    • Constructor Detail

      • AbstractWebSocketHandler

        public AbstractWebSocketHandler()
    • Method Detail

      • afterConnectionEstablished

        public void afterConnectionEstablished(WebSocketSession session)
                                        throws java.lang.Exception
        Description copied from interface: WebSocketHandler
        Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use.
        Specified by:
        afterConnectionEstablished in interface WebSocketHandler
        Throws:
        java.lang.Exception - this method can handle or propagate exceptions; see class-level Javadoc for details.
      • handleMessage

        public void handleMessage(WebSocketSession session,
                                  WebSocketMessage<?> message)
                           throws java.lang.Exception
        Description copied from interface: WebSocketHandler
        Invoked when a new WebSocket message arrives.
        Specified by:
        handleMessage in interface WebSocketHandler
        Throws:
        java.lang.Exception - this method can handle or propagate exceptions; see class-level Javadoc for details.
      • handleTextMessage

        protected void handleTextMessage(WebSocketSession session,
                                         TextMessage message)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • handleBinaryMessage

        protected void handleBinaryMessage(WebSocketSession session,
                                           BinaryMessage message)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • handlePongMessage

        protected void handlePongMessage(WebSocketSession session,
                                         PongMessage message)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • handleTransportError

        public void handleTransportError(WebSocketSession session,
                                         java.lang.Throwable exception)
                                  throws java.lang.Exception
        Description copied from interface: WebSocketHandler
        Handle an error from the underlying WebSocket message transport.
        Specified by:
        handleTransportError in interface WebSocketHandler
        Throws:
        java.lang.Exception - this method can handle or propagate exceptions; see class-level Javadoc for details.
      • afterConnectionClosed

        public void afterConnectionClosed(WebSocketSession session,
                                          CloseStatus status)
                                   throws java.lang.Exception
        Description copied from interface: WebSocketHandler
        Invoked after the WebSocket connection has been closed by either side, or after a transport error has occurred. Although the session may technically still be open, depending on the underlying implementation, sending messages at this point is discouraged and most likely will not succeed.
        Specified by:
        afterConnectionClosed in interface WebSocketHandler
        Throws:
        java.lang.Exception - this method can handle or propagate exceptions; see class-level Javadoc for details.