public class LoggingWebSocketHandlerDecorator extends WebSocketHandlerDecorator
WebSocketHandlerDecorator
that adds logging to WebSocket lifecycle events.Constructor and Description |
---|
LoggingWebSocketHandlerDecorator(WebSocketHandler delegate) |
Modifier and Type | Method and Description |
---|---|
void |
afterConnectionClosed(WebSocketSession session,
CloseStatus closeStatus)
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.
|
void |
handleMessage(WebSocketSession session,
WebSocketMessage<?> message)
Invoked when a new WebSocket message arrives.
|
void |
handleTransportError(WebSocketSession session,
Throwable exception)
Handle an error from the underlying WebSocket message transport.
|
getDelegate, getLastHandler, supportsPartialMessages, toString, unwrap
public LoggingWebSocketHandlerDecorator(WebSocketHandler delegate)
public void afterConnectionEstablished(WebSocketSession session) throws Exception
WebSocketHandler
afterConnectionEstablished
in interface WebSocketHandler
afterConnectionEstablished
in class WebSocketHandlerDecorator
Exception
- this method can handle or propagate exceptions; see class-level
Javadoc for details.public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception
WebSocketHandler
handleMessage
in interface WebSocketHandler
handleMessage
in class WebSocketHandlerDecorator
Exception
- this method can handle or propagate exceptions; see class-level
Javadoc for details.public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception
WebSocketHandler
handleTransportError
in interface WebSocketHandler
handleTransportError
in class WebSocketHandlerDecorator
Exception
- this method can handle or propagate exceptions; see class-level
Javadoc for details.public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception
WebSocketHandler
afterConnectionClosed
in interface WebSocketHandler
afterConnectionClosed
in class WebSocketHandlerDecorator
Exception
- this method can handle or propagate exceptions; see class-level
Javadoc for details.