Protected method to decorate WebSocketHandler
See gh-24075
This commit is contained in:
parent
526d89e1e6
commit
f57f337104
|
@ -77,10 +77,20 @@ public class WebSocketHttpRequestHandler implements HttpRequestHandler, Lifecycl
|
||||||
public WebSocketHttpRequestHandler(WebSocketHandler wsHandler, HandshakeHandler handshakeHandler) {
|
public WebSocketHttpRequestHandler(WebSocketHandler wsHandler, HandshakeHandler handshakeHandler) {
|
||||||
Assert.notNull(wsHandler, "wsHandler must not be null");
|
Assert.notNull(wsHandler, "wsHandler must not be null");
|
||||||
Assert.notNull(handshakeHandler, "handshakeHandler 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;
|
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.
|
* Return the WebSocketHandler.
|
||||||
|
|
Loading…
Reference in New Issue