public class JettyRequestUpgradeStrategy extends 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<Void> |
upgrade(org.springframework.web.server.ServerWebExchange exchange,
WebSocketHandler handler,
String subProtocol,
Supplier<HandshakeInfo> handshakeInfoFactory)
Upgrade to a WebSocket session and handle it with the given handler.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupgradepublic 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<Void> upgrade(org.springframework.web.server.ServerWebExchange exchange, WebSocketHandler handler, @Nullable String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory)
RequestUpgradeStrategyupgrade in interface RequestUpgradeStrategyexchange - the current exchangehandler - handler for the WebSocket sessionsubProtocol - the selected sub-protocol got the handlerhandshakeInfoFactory - factory to create HandshakeInfo for the WebSocket sessionMono<Void> to indicate the outcome of the
WebSocket session handling.