Implementations of this interface are encouraged to handle exceptions locally where
it makes sense or alternatively let the exception bubble up in which case by default
the exception is logged and the session closed with
SERVER_ERROR(1011). The exception handling
strategy is provided by
ExceptionWebSocketHandlerDecorator and it can be customized or replaced by decorating
the WebSocketHandler with a different decorator.
| Modifier and Type | Method and Description |
|---|---|
| public void | afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus)
Invoked after the WebSocket connection has been closed by either side, or after a transport error has occurred. |
| public void | afterConnectionEstablished(WebSocketSession session)
Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use. |
| public void | handleMessage(WebSocketSession session, WebSocketMessage<?> message)
Invoked when a new WebSocket message arrives. |
| public void | handleTransportError(WebSocketSession session, Throwable exception)
Handle an error from the underlying WebSocket message transport. |
| public boolean |
| afterConnectionClosed | back to summary |
|---|---|
| public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception 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.
| |
| afterConnectionEstablished | back to summary |
|---|---|
| public void afterConnectionEstablished(WebSocketSession session) throws Exception Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use.
| |
| handleMessage | back to summary |
|---|---|
| public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception Invoked when a new WebSocket message arrives.
| |
| handleTransportError | back to summary |
|---|---|
| public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception Handle an error from the underlying WebSocket message transport.
| |
| supportsPartialMessages | back to summary |
|---|---|
| public boolean supportsPartialMessages() Whether the WebSocketHandler handles partial messages. If this flag is set to
| |