Class WebMvcStompEndpointRegistry
java.lang.Object
org.springframework.web.socket.config.annotation.WebMvcStompEndpointRegistry
- All Implemented Interfaces:
StompEndpointRegistry
A registry for STOMP over WebSocket endpoints that maps the endpoints with a
HandlerMapping for use in Spring MVC.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Artem Bilan
-
Constructor Summary
ConstructorsConstructorDescriptionWebMvcStompEndpointRegistry(WebSocketHandler webSocketHandler, WebSocketTransportRegistration transportRegistration, org.springframework.scheduling.TaskScheduler defaultSockJsTaskScheduler) -
Method Summary
Modifier and TypeMethodDescriptionaddEndpoint(String... paths) Register a STOMP over WebSocket endpoint at the given mapping path.org.springframework.web.servlet.handler.AbstractHandlerMappingReturn a handler mapping with the mapped ViewControllers.protected intgetOrder()protected org.springframework.web.util.UrlPathHelperprotected voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) setErrorHandler(StompSubProtocolErrorHandler errorHandler) Configure a handler for customizing or handling STOMP ERROR frames to clients.voidsetOrder(int order) Set the order for the resultingHandlerMappingrelative to other handler mappings configured in Spring MVC.voidsetUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper) Set the UrlPathHelper to configure on theHandlerMappingused to map handshake requests.
-
Constructor Details
-
WebMvcStompEndpointRegistry
public WebMvcStompEndpointRegistry(WebSocketHandler webSocketHandler, WebSocketTransportRegistration transportRegistration, org.springframework.scheduling.TaskScheduler defaultSockJsTaskScheduler)
-
-
Method Details
-
addEndpoint
Description copied from interface:StompEndpointRegistryRegister a STOMP over WebSocket endpoint at the given mapping path.- Specified by:
addEndpointin interfaceStompEndpointRegistry
-
setOrder
public void setOrder(int order) Set the order for the resultingHandlerMappingrelative to other handler mappings configured in Spring MVC.The default value is 1.
- Specified by:
setOrderin interfaceStompEndpointRegistry
-
getOrder
protected int getOrder() -
setUrlPathHelper
public void setUrlPathHelper(@Nullable org.springframework.web.util.UrlPathHelper urlPathHelper) Set the UrlPathHelper to configure on theHandlerMappingused to map handshake requests.- Specified by:
setUrlPathHelperin interfaceStompEndpointRegistry
-
getUrlPathHelper
@Nullable protected org.springframework.web.util.UrlPathHelper getUrlPathHelper() -
setErrorHandler
Description copied from interface:StompEndpointRegistryConfigure a handler for customizing or handling STOMP ERROR frames to clients.- Specified by:
setErrorHandlerin interfaceStompEndpointRegistry- Parameters:
errorHandler- the error handler
-
setApplicationContext
protected void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) -
getHandlerMapping
public org.springframework.web.servlet.handler.AbstractHandlerMapping getHandlerMapping()Return a handler mapping with the mapped ViewControllers.
-