public class WebSocketHttpRequestHandler extends java.lang.Object implements HttpRequestHandler
HttpRequestHandler for processing WebSocket handshake requests.
This is the main class to use when configuring a server WebSocket at a specific URL. It
is a very thin wrapper around a HandshakeHandler and a WebSocketHandler
instance also adapting the HttpServletRequest and HttpServletResponse
to ServerHttpRequest and ServerHttpResponse respectively.
The decorateWebSocketHandler(WebSocketHandler) method decorates the given
WebSocketHandler with a logging and exception handling decorators. This method can
be overridden to change that.
| Constructor and Description |
|---|
WebSocketHttpRequestHandler(WebSocketHandler webSocketHandler) |
WebSocketHttpRequestHandler(WebSocketHandler webSocketHandler,
HandshakeHandler handshakeHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected WebSocketHandler |
decorateWebSocketHandler(WebSocketHandler handler)
Decorate the WebSocketHandler provided to the class constructor.
|
void |
handleRequest(HttpServletRequest request,
HttpServletResponse response)
Process the given request, generating a response.
|
public WebSocketHttpRequestHandler(WebSocketHandler webSocketHandler)
public WebSocketHttpRequestHandler(WebSocketHandler webSocketHandler, HandshakeHandler handshakeHandler)
protected WebSocketHandler decorateWebSocketHandler(WebSocketHandler handler)
By default ExceptionWebSocketHandlerDecorator and
LoggingWebSocketHandlerDecorator are applied are added.
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
HttpRequestHandlerhandleRequest in interface HttpRequestHandlerrequest - current HTTP requestresponse - current HTTP responseServletException - in case of general errorsjava.io.IOException - in case of I/O errors