HandlerAdapter that allows
org.springframework.web.reactive.DispatcherHandler to support
handlers of type WebSocketHandler with such handlers mapped to
URL patterns via
org.springframework.web.reactive.handler.SimpleUrlHandlerMapping .
Requests are handled by delegating to a
WebSocketService, by default HandshakeWebSocketService,
which checks the WebSocket handshake request parameters, upgrades to a
WebSocket interaction, and uses the WebSocketHandler to handle it.
As of 5.3 the WebFlux Java configuration, imported via
@EnableWebFlux, includes a declaration of this adapter and therefore
it no longer needs to be present in application configuration.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final WebSocketService |
| Access | Constructor and Description |
|---|---|
| public | |
| public | WebSocketHandlerAdapter(WebSocketService webSocketService)
Alternative constructor with the |
| Modifier and Type | Method and Description |
|---|---|
| public int | getOrder()
Implements org. Return the |
| public WebSocketService | |
| public Mono | handle(ServerWebExchange
current server exchange exchange, Object the selected handler which must have been previously
checked via handler)supports(Object)Implements org. Handle the request with the given handler, previously checked via
|
| public void | |
| public boolean | supports(Object
the handler object to check handler)Implements org. Whether this |
| order | back to summary |
|---|---|
| private int order | |
| webSocketService | back to summary |
|---|---|
| private final WebSocketService webSocketService | |
| WebSocketHandlerAdapter | back to summary |
|---|---|
| public WebSocketHandlerAdapter() Default constructor that creates and uses a
| |
| WebSocketHandlerAdapter | back to summary |
|---|---|
| public WebSocketHandlerAdapter(WebSocketService webSocketService) Alternative constructor with the | |
| getOrder | back to summary |
|---|---|
| public int getOrder() Implements org. Return the
| |
| getWebSocketService | back to summary |
|---|---|
| public WebSocketService getWebSocketService() Return the configured | |
| handle | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Handle the request with the given handler, previously checked via
Implementations should consider the following for exception handling:
| |
| setOrder | back to summary |
|---|---|
| public void setOrder(int order) Set the order value for this adapter. By default this is set to 2.
| |
| supports | back to summary |
|---|---|
| public boolean supports(Object handler) Implements org. Doc from org. Whether this | |