Top Description Fields Constructors Methods
org.springframework.web.socket.handler

public Class LoggingWebSocketHandlerDecorator

extends WebSocketHandlerDecorator
Class Inheritance
Imports
org.apache.commons.logging.Log, .LogFactory, org.springframework.web.socket.CloseStatus, .WebSocketHandler, .WebSocketMessage, .WebSocketSession

A WebSocketHandlerDecorator that adds logging to WebSocket lifecycle events.
Author
Rossen Stoyanchev
Since
4.0

Field Summary

Modifier and TypeField and Description
private static final Log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus)

Overrides org.springframework.web.socket.handler.WebSocketHandlerDecorator.afterConnectionClosed.

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionClosed.

Invoked after the WebSocket connection has been closed by either side, or after a transport error has occurred.

public void
afterConnectionEstablished(WebSocketSession session)

Overrides org.springframework.web.socket.handler.WebSocketHandlerDecorator.afterConnectionEstablished.

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionEstablished.

Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use.

public void
public void
Inherited from org.springframework.web.socket.handler.WebSocketHandlerDecorator:
getDelegategetLastHandlersupportsPartialMessagestoStringunwrap

Field Detail

loggerback to summary
private static final Log logger

Constructor Detail

LoggingWebSocketHandlerDecoratorback to summary
public LoggingWebSocketHandlerDecorator(WebSocketHandler delegate)

Method Detail

afterConnectionClosedback to summary
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception

Overrides org.springframework.web.socket.handler.WebSocketHandlerDecorator.afterConnectionClosed.

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionClosed.

Doc from org.springframework.web.socket.WebSocketHandler.afterConnectionClosed.

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.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.
afterConnectionEstablishedback to summary
public void afterConnectionEstablished(WebSocketSession session) throws Exception

Overrides org.springframework.web.socket.handler.WebSocketHandlerDecorator.afterConnectionEstablished.

Implements org.springframework.web.socket.WebSocketHandler.afterConnectionEstablished.

Doc from org.springframework.web.socket.WebSocketHandler.afterConnectionEstablished.

Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.
handleMessageback to summary
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception

Overrides org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage.

Implements org.springframework.web.socket.WebSocketHandler.handleMessage.

Doc from org.springframework.web.socket.WebSocketHandler.handleMessage.

Invoked when a new WebSocket message arrives.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.
handleTransportErrorback to summary
public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception

Overrides org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleTransportError.

Implements org.springframework.web.socket.WebSocketHandler.handleTransportError.

Doc from org.springframework.web.socket.WebSocketHandler.handleTransportError.

Handle an error from the underlying WebSocket message transport.

Annotations
@Override
Exceptions
Exception:
this method can handle or propagate exceptions; see class-level Javadoc for details.