org.springframework.web.socket.handler

Class PerConnectionWebSocketHandler

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

      • PerConnectionWebSocketHandler

        public PerConnectionWebSocketHandler(java.lang.Class<? extends WebSocketHandler> handlerType)
      • PerConnectionWebSocketHandler

        public PerConnectionWebSocketHandler(java.lang.Class<? extends WebSocketHandler> handlerType,
                                             boolean supportsPartialMessages)
    • 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.
      • 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 closeStatus)
                                   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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object