public abstract class AbstractWebSocketHandlerRegistration<M> extends Object implements WebSocketHandlerRegistration
WebSocketHandlerRegistration
s that gathers all the configuration
options but allows sub-classes to put together the actual HTTP request mappings.Constructor and Description |
---|
AbstractWebSocketHandlerRegistration(TaskScheduler defaultTaskScheduler) |
Modifier and Type | Method and Description |
---|---|
WebSocketHandlerRegistration |
addHandler(WebSocketHandler handler,
String... paths)
Add more handlers that will share the same configuration (interceptors, SockJS
config, etc)
|
WebSocketHandlerRegistration |
addInterceptors(HandshakeInterceptor... interceptors)
Configure interceptors for the handshake request.
|
protected abstract void |
addSockJsServiceMapping(M mappings,
SockJsService sockJsService,
WebSocketHandler handler,
String pathPattern) |
protected abstract void |
addWebSocketHandlerMapping(M mappings,
WebSocketHandler wsHandler,
HandshakeHandler handshakeHandler,
HandshakeInterceptor[] interceptors,
String path) |
protected abstract M |
createMappings() |
HandshakeHandler |
getHandshakeHandler() |
protected HandshakeInterceptor[] |
getInterceptors() |
M |
getMappings() |
WebSocketHandlerRegistration |
setHandshakeHandler(HandshakeHandler handshakeHandler)
Configure the HandshakeHandler to use.
|
void |
setInterceptors(HandshakeInterceptor[] interceptors) |
SockJsServiceRegistration |
withSockJS()
Enable SockJS fallback options.
|
public AbstractWebSocketHandlerRegistration(TaskScheduler defaultTaskScheduler)
public WebSocketHandlerRegistration addHandler(WebSocketHandler handler, String... paths)
WebSocketHandlerRegistration
addHandler
in interface WebSocketHandlerRegistration
public WebSocketHandlerRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)
WebSocketHandlerRegistration
setHandshakeHandler
in interface WebSocketHandlerRegistration
public HandshakeHandler getHandshakeHandler()
public WebSocketHandlerRegistration addInterceptors(HandshakeInterceptor... interceptors)
WebSocketHandlerRegistration
addInterceptors
in interface WebSocketHandlerRegistration
protected HandshakeInterceptor[] getInterceptors()
public void setInterceptors(HandshakeInterceptor[] interceptors)
interceptors
- the interceptors to setpublic SockJsServiceRegistration withSockJS()
WebSocketHandlerRegistration
withSockJS
in interface WebSocketHandlerRegistration
public final M getMappings()
protected abstract M createMappings()
protected abstract void addSockJsServiceMapping(M mappings, SockJsService sockJsService, WebSocketHandler handler, String pathPattern)
protected abstract void addWebSocketHandlerMapping(M mappings, WebSocketHandler wsHandler, HandshakeHandler handshakeHandler, HandshakeInterceptor[] interceptors, String path)