Class JettyCoreRequestUpgradeStrategy
java.lang.Object
org.springframework.web.reactive.socket.server.upgrade.JettyCoreRequestUpgradeStrategy
- All Implemented Interfaces:
RequestUpgradeStrategy
A WebSocket
RequestUpgradeStrategy
for Jetty 12 Core.- Since:
- 6.2
- Author:
- Rossen Stoyanchev, Greg Wilkins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addWebSocketConfigurer
(Consumer<org.eclipse.jetty.websocket.api.Configurable> webSocketConfigurer) Add a callback to configure WebSocket server parameters onJettyWebSocketServerContainer
.reactor.core.publisher.Mono<Void>
upgrade
(ServerWebExchange exchange, WebSocketHandler handler, String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory) Upgrade to a WebSocket session and handle it with the given handler.
-
Constructor Details
-
JettyCoreRequestUpgradeStrategy
public JettyCoreRequestUpgradeStrategy()
-
-
Method Details
-
addWebSocketConfigurer
public void addWebSocketConfigurer(Consumer<org.eclipse.jetty.websocket.api.Configurable> webSocketConfigurer) Add a callback to configure WebSocket server parameters onJettyWebSocketServerContainer
. -
upgrade
public reactor.core.publisher.Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler handler, @Nullable String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory) Description copied from interface:RequestUpgradeStrategy
Upgrade to a WebSocket session and handle it with the given handler.- Specified by:
upgrade
in interfaceRequestUpgradeStrategy
- Parameters:
exchange
- the current exchangehandler
- handler for the WebSocket sessionsubProtocol
- the selected sub-protocol got the handlerhandshakeInfoFactory
- factory to create HandshakeInfo for the WebSocket session- Returns:
- completion
Mono<Void>
to indicate the outcome of the WebSocket session handling.
-