public class JettyRequestUpgradeStrategy extends java.lang.Object implements RequestUpgradeStrategy, org.springframework.context.Lifecycle
RequestUpgradeStrategy for use with Jetty.| Constructor and Description |
|---|
JettyRequestUpgradeStrategy() |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.jetty.websocket.api.WebSocketPolicy |
getWebSocketPolicy()
Return the configured
WebSocketPolicy, if any. |
boolean |
isRunning() |
void |
setWebSocketPolicy(org.eclipse.jetty.websocket.api.WebSocketPolicy webSocketPolicy)
Configure a
WebSocketPolicy to use to initialize
WebSocketServerFactory. |
void |
start() |
void |
stop() |
reactor.core.publisher.Mono<java.lang.Void> |
upgrade(org.springframework.web.server.ServerWebExchange exchange,
WebSocketHandler handler,
java.lang.String subProtocol)
Upgrade to a WebSocket session and handle it with the given handler.
|
public void setWebSocketPolicy(org.eclipse.jetty.websocket.api.WebSocketPolicy webSocketPolicy)
WebSocketPolicy to use to initialize
WebSocketServerFactory.webSocketPolicy - the WebSocket settings@Nullable public org.eclipse.jetty.websocket.api.WebSocketPolicy getWebSocketPolicy()
WebSocketPolicy, if any.public void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic reactor.core.publisher.Mono<java.lang.Void> upgrade(org.springframework.web.server.ServerWebExchange exchange,
WebSocketHandler handler,
@Nullable
java.lang.String subProtocol)
RequestUpgradeStrategyupgrade in interface RequestUpgradeStrategyexchange - the current exchangehandler - handler for the WebSocket sessionsubProtocol - the selected sub-protocol got the handlerMono<Void> to indicate the outcome of the
WebSocket session handling.