Skip to content

Commit

Permalink
Protected method to decorate WebSocketHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Nov 26, 2019
1 parent 526d89e commit f57f337
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -77,10 +77,20 @@ public WebSocketHttpRequestHandler(WebSocketHandler wsHandler) {
public WebSocketHttpRequestHandler(WebSocketHandler wsHandler, HandshakeHandler handshakeHandler) {
Assert.notNull(wsHandler, "wsHandler must not be null");
Assert.notNull(handshakeHandler, "handshakeHandler must not be null");
this.wsHandler = new ExceptionWebSocketHandlerDecorator(new LoggingWebSocketHandlerDecorator(wsHandler));
this.wsHandler = decorate(wsHandler);
this.handshakeHandler = handshakeHandler;
}

/**
* Decorate the {@code WebSocketHandler} passed into the constructor.
* <p>By default, {@link LoggingWebSocketHandlerDecorator} and
* {@link ExceptionWebSocketHandlerDecorator} are added.
* @since 5.2.2
*/
protected WebSocketHandler decorate(WebSocketHandler handler) {
return new ExceptionWebSocketHandlerDecorator(new LoggingWebSocketHandlerDecorator(handler));
}


/**
* Return the WebSocketHandler.
Expand Down

0 comments on commit f57f337

Please sign in to comment.