|
|
|
@ -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. |
|
|
|
|