public class ServletWebSocketHandlerRegistry extends Object implements WebSocketHandlerRegistry
WebSocketHandlerRegistry
that maps WebSocketHandler
s to URLs for use
in a Servlet container.Constructor and Description |
---|
ServletWebSocketHandlerRegistry() |
ServletWebSocketHandlerRegistry(ThreadPoolTaskScheduler scheduler)
Deprecated.
as of 5.0 a TaskScheduler is not provided upfront, not until
it is obvious that it is needed, see
requiresTaskScheduler() and
setTaskScheduler(org.springframework.scheduling.TaskScheduler) . |
Modifier and Type | Method and Description |
---|---|
WebSocketHandlerRegistration |
addHandler(WebSocketHandler handler,
String... paths)
Configure a WebSocketHandler at the specified URL paths.
|
AbstractHandlerMapping |
getHandlerMapping() |
int |
getOrder() |
UrlPathHelper |
getUrlPathHelper() |
protected boolean |
requiresTaskScheduler()
Whether there are any endpoint SockJS registrations without a TaskScheduler.
|
void |
setOrder(int order)
Set the order for the resulting
SimpleUrlHandlerMapping relative to
other handler mappings configured in Spring MVC. |
protected void |
setTaskScheduler(TaskScheduler scheduler)
Configure a TaskScheduler for SockJS endpoints.
|
void |
setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to configure on the
SimpleUrlHandlerMapping
used to map handshake requests. |
public ServletWebSocketHandlerRegistry()
@Deprecated public ServletWebSocketHandlerRegistry(ThreadPoolTaskScheduler scheduler)
requiresTaskScheduler()
and
setTaskScheduler(org.springframework.scheduling.TaskScheduler)
.public WebSocketHandlerRegistration addHandler(WebSocketHandler handler, String... paths)
WebSocketHandlerRegistry
addHandler
in interface WebSocketHandlerRegistry
public void setOrder(int order)
SimpleUrlHandlerMapping
relative to
other handler mappings configured in Spring MVC.
The default value is 1.
public int getOrder()
public void setUrlPathHelper(@Nullable UrlPathHelper urlPathHelper)
SimpleUrlHandlerMapping
used to map handshake requests.@Nullable public UrlPathHelper getUrlPathHelper()
protected boolean requiresTaskScheduler()
getHandlerMapping()
to
allow for registrations to be made first.protected void setTaskScheduler(TaskScheduler scheduler)
getHandlerMapping()
after checking if
requiresTaskScheduler()
returns true
.public AbstractHandlerMapping getHandlerMapping()