public interface WebSocketListener extends SubProtocolCapable
WebSocketMessages messages as part of a higher
level protocol, referred to as "sub-protocol" in the WebSocket RFC specification.
Implementations of this interface can be configured on a
IntegrationWebSocketContainer which delegates messages and
WebSocketSession events to this implementation.
WebSocketInboundChannelAdapter| Modifier and Type | Method and Description |
|---|---|
void |
afterSessionEnded(WebSocketSession session,
CloseStatus closeStatus)
Invoked after a
WebSocketSession has ended. |
void |
afterSessionStarted(WebSocketSession session)
Invoked after a
WebSocketSession has started. |
void |
onMessage(WebSocketSession session,
WebSocketMessage<?> message)
Handle the received
WebSocketMessage. |
getSubProtocolsvoid onMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception
WebSocketMessage.session - the WebSocket sessionmessage - the WebSocket messageException - the 'onMessage' Exceptionvoid afterSessionStarted(WebSocketSession session) throws Exception
WebSocketSession has started.session - the WebSocket sessionException - the 'afterSessionStarted' Exceptionvoid afterSessionEnded(WebSocketSession session, CloseStatus closeStatus) throws Exception
WebSocketSession has ended.session - the WebSocket sessioncloseStatus - the reason why the session was closedException - the 'afterSessionEnded' Exception