public abstract class AbstractWebSocketHandler extends Object implements WebSocketHandler
WebSocketHandler implementation with empty methods.| Constructor and Description |
|---|
AbstractWebSocketHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterConnectionClosed(WebSocketSession session,
CloseStatus status)
Invoked after the WebSocket connection has been closed by either side, or after a
transport error has occurred.
|
void |
afterConnectionEstablished(WebSocketSession session)
Invoked after WebSocket negotiation has succeeded and the WebSocket connection is
opened and ready for use.
|
protected void |
handleBinaryMessage(WebSocketSession session,
BinaryMessage message) |
void |
handleMessage(WebSocketSession session,
WebSocketMessage<?> message)
Invoked when a new WebSocket message arrives.
|
protected void |
handlePongMessage(WebSocketSession session,
PongMessage message) |
protected void |
handleTextMessage(WebSocketSession session,
TextMessage message) |
void |
handleTransportError(WebSocketSession session,
Throwable exception)
Handle an error from the underlying WebSocket message transport.
|
boolean |
supportsPartialMessages()
Whether the WebSocketHandler handles partial messages.
|
public void afterConnectionEstablished(WebSocketSession session) throws Exception
WebSocketHandlerafterConnectionEstablished in interface WebSocketHandlerException - this method can handle or propagate exceptions; see class-level
Javadoc for details.public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception
WebSocketHandlerhandleMessage in interface WebSocketHandlerException - this method can handle or propagate exceptions; see class-level
Javadoc for details.protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception
Exceptionprotected void handleBinaryMessage(WebSocketSession session, BinaryMessage message) throws Exception
Exceptionprotected void handlePongMessage(WebSocketSession session, PongMessage message) throws Exception
Exceptionpublic void handleTransportError(WebSocketSession session, Throwable exception) throws Exception
WebSocketHandlerhandleTransportError in interface WebSocketHandlerException - this method can handle or propagate exceptions; see class-level
Javadoc for details.public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception
WebSocketHandlerafterConnectionClosed in interface WebSocketHandlerException - this method can handle or propagate exceptions; see class-level
Javadoc for details.public boolean supportsPartialMessages()
WebSocketHandlertrue and the underlying WebSocket server supports partial messages,
then a large WebSocket message, or one of an unknown size may be split and
maybe received over multiple calls to
WebSocketHandler.handleMessage(WebSocketSession, WebSocketMessage). The flag
WebSocketMessage.isLast() indicates if
the message is partial and whether it is the last part.supportsPartialMessages in interface WebSocketHandler