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 WebSocketHandler and a HandshakeHandler,
also adapting the HttpServletRequest and HttpServletResponse to
ServerHttpRequest and ServerHttpResponse, respectively.
| Modifier and Type | Field and Description |
|---|---|
| private final HandshakeHandler | |
| private final List | |
| private static final Log | |
| private volatile boolean | |
| private final WebSocketHandler |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected WebSocketHandler | |
| public HandshakeHandler | |
| public List | |
| public WebSocketHandler | |
| public void | handleRequest(HttpServletRequest
current HTTP request servletRequest, HttpServletResponse current HTTP response servletResponse)Implements org. Process the given request, generating a response. |
| public boolean | isRunning()
Implements org. Check whether this component is currently running. |
| public void | setHandshakeInterceptors(List<HandshakeInterceptor> interceptors)
Configure one or more WebSocket handshake request interceptors. |
| public void | setServletContext(ServletContext
the ServletContext object to be used by this object servletContext)Implements org. Set the Invoked after population of normal bean properties but before an init
callback like InitializingBean's |
| public void | |
| public void | stop()
Implements org. Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. |
| handshakeHandler | back to summary |
|---|---|
| private final HandshakeHandler handshakeHandler | |
| interceptors | back to summary |
|---|---|
| private final List<HandshakeInterceptor> interceptors | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| wsHandler | back to summary |
|---|---|
| private final WebSocketHandler wsHandler | |
| WebSocketHttpRequestHandler | back to summary |
|---|---|
| public WebSocketHttpRequestHandler(WebSocketHandler wsHandler) | |
| WebSocketHttpRequestHandler | back to summary |
|---|---|
| public WebSocketHttpRequestHandler(WebSocketHandler wsHandler, HandshakeHandler handshakeHandler) | |
| decorate | back to summary |
|---|---|
| protected WebSocketHandler decorate(WebSocketHandler handler) Decorate the By default,
| |
| getHandshakeHandler | back to summary |
|---|---|
| public HandshakeHandler getHandshakeHandler() Return the HandshakeHandler. | |
| getHandshakeInterceptors | back to summary |
|---|---|
| public List Return the configured WebSocket handshake request interceptors. | |
| getWebSocketHandler | back to summary |
|---|---|
| public WebSocketHandler getWebSocketHandler() Return the WebSocketHandler. | |
| handleRequest | back to summary |
|---|---|
| public void handleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException Implements org. Doc from org. Process the given request, generating a response.
| |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| setHandshakeInterceptors | back to summary |
|---|---|
| public void setHandshakeInterceptors(List<HandshakeInterceptor> interceptors) Configure one or more WebSocket handshake request interceptors. | |
| setServletContext | back to summary |
|---|---|
| public void setServletContext(ServletContext servletContext) Implements org. Doc from org. Set the Invoked after population of normal bean properties but before an init
callback like InitializingBean's
| |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |