Class ServletWebSocketHandlerRegistry
- java.lang.Object
- org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry
- All Implemented Interfaces:
WebSocketHandlerRegistry
public class ServletWebSocketHandlerRegistry extends Object implements WebSocketHandlerRegistry
AWebSocketHandlerRegistrythat mapsWebSocketHandlers to URLs for use in a Servlet container.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
Constructor Summary
Constructors Constructor Description ServletWebSocketHandlerRegistry(ThreadPoolTaskScheduler sockJsTaskScheduler)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSocketHandlerRegistrationaddHandler(WebSocketHandler webSocketHandler, String... paths)Configure a WebSocketHandler at the specified URL paths.AbstractHandlerMappinggetHandlerMapping()Return aHandlerMappingwith mappedHttpRequestHandlers.intgetOrder()UrlPathHelpergetUrlPathHelper()voidsetOrder(int order)Set the order for the resultingSimpleUrlHandlerMappingrelative to other handler mappings configured in Spring MVC.voidsetUrlPathHelper(UrlPathHelper urlPathHelper)Set the UrlPathHelper to configure on theSimpleUrlHandlerMappingused to map handshake requests.
Constructor Detail
ServletWebSocketHandlerRegistry
public ServletWebSocketHandlerRegistry(ThreadPoolTaskScheduler sockJsTaskScheduler)
Method Detail
addHandler
public WebSocketHandlerRegistration addHandler(WebSocketHandler webSocketHandler, String... paths)
Description copied from interface:WebSocketHandlerRegistryConfigure a WebSocketHandler at the specified URL paths.- Specified by:
addHandlerin interfaceWebSocketHandlerRegistry
setOrder
public void setOrder(int order)
Set the order for the resultingSimpleUrlHandlerMappingrelative to other handler mappings configured in Spring MVC.The default value is 1.
getOrder
public int getOrder()
setUrlPathHelper
public void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to configure on theSimpleUrlHandlerMappingused to map handshake requests.
getUrlPathHelper
public UrlPathHelper getUrlPathHelper()
getHandlerMapping
public AbstractHandlerMapping getHandlerMapping()
Return aHandlerMappingwith mappedHttpRequestHandlers.