public class ServerWebSocketContainer extends IntegrationWebSocketContainer implements WebSocketConfigurer, SmartLifecycle
IntegrationWebSocketContainer
implementation for the server
WebSocketHandler
registration.
Registers an internal IntegrationWebSocketContainer.IntegrationWebSocketHandler
for provided paths
with the WebSocketHandlerRegistry
.
The real registration is based on Spring Web-Socket infrastructure via WebSocketConfigurer
implementation of this class.
Modifier and Type | Class and Description |
---|---|
static class |
ServerWebSocketContainer.SockJsServiceOptions |
DEFAULT_SEND_BUFFER_SIZE, DEFAULT_SEND_TIME_LIMIT, logger, sessions, webSocketHandler
DEFAULT_PHASE
Constructor and Description |
---|
ServerWebSocketContainer(String... paths) |
Modifier and Type | Method and Description |
---|---|
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
registerWebSocketHandlers(WebSocketHandlerRegistry registry) |
ServerWebSocketContainer |
setAllowedOrigins(String... origins)
Configure allowed
Origin header values. |
void |
setAutoStartup(boolean autoStartup) |
ServerWebSocketContainer |
setDecoratorFactories(WebSocketHandlerDecoratorFactory... factories)
Configure one or more factories to decorate the handler used to process
WebSocket messages.
|
ServerWebSocketContainer |
setHandshakeHandler(HandshakeHandler handshakeHandler) |
ServerWebSocketContainer |
setInterceptors(HandshakeInterceptor... interceptors) |
void |
setPhase(int phase) |
void |
setSockJsServiceOptions(ServerWebSocketContainer.SockJsServiceOptions sockJsServiceOptions) |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
ServerWebSocketContainer |
withSockJs(ServerWebSocketContainer.SockJsServiceOptions... sockJsServiceOptions) |
addSupportedProtocols, closeSession, destroy, getSession, getSessions, getSubProtocols, setMessageListener, setSendBufferSizeLimit, setSendTimeLimit, setSupportedProtocols
public ServerWebSocketContainer(String... paths)
public ServerWebSocketContainer setHandshakeHandler(HandshakeHandler handshakeHandler)
public ServerWebSocketContainer setInterceptors(HandshakeInterceptor... interceptors)
public ServerWebSocketContainer setDecoratorFactories(WebSocketHandlerDecoratorFactory... factories)
factories
- the WebSocketHandlerDecoratorFactory array to usepublic ServerWebSocketContainer setAllowedOrigins(String... origins)
Origin
header values.origins
- the origins to allow.WebSocketHandlerRegistration.setAllowedOrigins(String...)
public ServerWebSocketContainer withSockJs(ServerWebSocketContainer.SockJsServiceOptions... sockJsServiceOptions)
public void setSockJsServiceOptions(ServerWebSocketContainer.SockJsServiceOptions sockJsServiceOptions)
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry)
registerWebSocketHandlers
in interface WebSocketConfigurer
public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle