Class ServletWebSocketHandlerRegistry
java.lang.Object
org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry
- All Implemented Interfaces:
WebSocketHandlerRegistry
WebSocketHandlerRegistry
with Spring MVC handler mappings for the
handshake requests.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHandler
(WebSocketHandler handler, String... paths) Configure a WebSocketHandler at the specified URL paths.int
getOrder()
Deprecated, for removal: This API element is subject to removal in a future version.protected boolean
Whether there are any endpoint SockJS registrations without a TaskScheduler.void
setOrder
(int order) Set the order for the resultingSimpleUrlHandlerMapping
relative to other handler mappings configured in Spring MVC.protected void
setTaskScheduler
(TaskScheduler scheduler) Provide the TaskScheduler to use for SockJS endpoints for which a task scheduler has not been explicitly registered.void
setUrlPathHelper
(UrlPathHelper urlPathHelper) Deprecated, for removal: This API element is subject to removal in a future version.without a replacement since effectively the UrlPathHelper is no longer used withPathPatternParser
used by the default in all extensions ofAbstractHandlerMapping
.
-
Constructor Details
-
ServletWebSocketHandlerRegistry
public ServletWebSocketHandlerRegistry()
-
-
Method Details
-
addHandler
Description copied from interface:WebSocketHandlerRegistry
Configure a WebSocketHandler at the specified URL paths.- Specified by:
addHandler
in interfaceWebSocketHandlerRegistry
-
setOrder
public void setOrder(int order) Set the order for the resultingSimpleUrlHandlerMapping
relative to other handler mappings configured in Spring MVC.The default value is 1.
-
getOrder
public int getOrder() -
setUrlPathHelper
@Deprecated(since="6.2.4", forRemoval=true) public void setUrlPathHelper(@Nullable UrlPathHelper urlPathHelper) Deprecated, for removal: This API element is subject to removal in a future version.without a replacement since effectively the UrlPathHelper is no longer used withPathPatternParser
used by the default in all extensions ofAbstractHandlerMapping
. To be removed in 7.0.Set the UrlPathHelper to configure on theSimpleUrlHandlerMapping
used to map handshake requests. -
getUrlPathHelper
Deprecated, for removal: This API element is subject to removal in a future version.without a replacement; see notice onsetUrlPathHelper(org.springframework.web.util.UrlPathHelper)
Return the configuredUrlPathHelper
. -
requiresTaskScheduler
protected boolean requiresTaskScheduler()Whether there are any endpoint SockJS registrations without a TaskScheduler. This method should be invoked just beforegetHandlerMapping()
to allow for registrations to be made first. -
setTaskScheduler
Provide the TaskScheduler to use for SockJS endpoints for which a task scheduler has not been explicitly registered. This method must be called prior togetHandlerMapping()
. -
getHandlerMapping
-
setUrlPathHelper(org.springframework.web.util.UrlPathHelper)