Top Description Fields Constructors Methods
org.springframework.web.socket.config.annotation

public Class WebMvcStompEndpointRegistry

extends Object
implements StompEndpointRegistry
Class Inheritance
All Implemented Interfaces
org.springframework.web.socket.config.annotation.StompEndpointRegistry
Imports
java.util.ArrayList, .LinkedHashMap, .List, .Map, org.springframework.context.ApplicationContext, org.springframework.lang.Nullable, org.springframework.scheduling.TaskScheduler, org.springframework.util.Assert, .MultiValueMap, org.springframework.web.HttpRequestHandler, org.springframework.web.servlet.handler.AbstractHandlerMapping, org.springframework.web.socket.WebSocketHandler, org.springframework.web.socket.handler.WebSocketHandlerDecorator, org.springframework.web.socket.messaging.StompSubProtocolErrorHandler, .StompSubProtocolHandler, .SubProtocolWebSocketHandler, org.springframework.web.socket.server.support.WebSocketHandlerMapping, org.springframework.web.util.UrlPathHelper

A registry for STOMP over WebSocket endpoints that maps the endpoints with a org.springframework.web.servlet.HandlerMapping for use in Spring MVC.
Authors
Rossen Stoyanchev, Artem Bilan
Since
4.0

Field Summary

Modifier and TypeField and Description
private int
private final List<WebMvcStompWebSocketEndpointRegistration>
private final TaskScheduler
private final StompSubProtocolHandler
private final SubProtocolWebSocketHandler
private UrlPathHelper
private final WebSocketHandler

Constructor Summary

AccessConstructor and Description
public
WebMvcStompEndpointRegistry(WebSocketHandler webSocketHandler, WebSocketTransportRegistration transportRegistration, TaskScheduler defaultSockJsTaskScheduler)

Method Summary

Modifier and TypeMethod and Description
public StompWebSocketEndpointRegistration
addEndpoint(String... paths)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.addEndpoint.

Register a STOMP over WebSocket endpoint at the given mapping path.

public AbstractHandlerMapping
getHandlerMapping()

Return a handler mapping with the mapped ViewControllers.

protected int
protected UrlPathHelper
protected boolean
protected void
public WebMvcStompEndpointRegistry
setErrorHandler(StompSubProtocolErrorHandler
the error handler
errorHandler
)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setErrorHandler.

Configure a handler for customizing or handling STOMP ERROR frames to clients.

public void
setOrder(int order)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setOrder.

Set the order for the resulting org.springframework.web.servlet.HandlerMapping relative to other handler mappings configured in Spring MVC.

public WebMvcStompEndpointRegistry
setPreserveReceiveOrder(boolean preserveReceiveOrder)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setPreserveReceiveOrder.

Whether to handle client messages sequentially in the order in which they were received.

public void
setUrlPathHelper(UrlPathHelper urlPathHelper)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setUrlPathHelper.

Set the UrlPathHelper to configure on the HandlerMapping used to map handshake requests.

private static SubProtocolWebSocketHandler
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

orderback to summary
private int order
registrationsback to summary
private final List<WebMvcStompWebSocketEndpointRegistration> registrations
sockJsSchedulerback to summary
private final TaskScheduler sockJsScheduler
stompHandlerback to summary
private final StompSubProtocolHandler stompHandler
subProtocolWebSocketHandlerback to summary
private final SubProtocolWebSocketHandler subProtocolWebSocketHandler
urlPathHelperback to summary
private UrlPathHelper urlPathHelper
Annotations
@Nullable
webSocketHandlerback to summary
private final WebSocketHandler webSocketHandler

Constructor Detail

WebMvcStompEndpointRegistryback to summary
public WebMvcStompEndpointRegistry(WebSocketHandler webSocketHandler, WebSocketTransportRegistration transportRegistration, TaskScheduler defaultSockJsTaskScheduler)

Method Detail

addEndpointback to summary
public StompWebSocketEndpointRegistration addEndpoint(String... paths)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.addEndpoint.

Doc from org.springframework.web.socket.config.annotation.StompEndpointRegistry.addEndpoint.

Register a STOMP over WebSocket endpoint at the given mapping path.

Annotations
@Override
getHandlerMappingback to summary
public AbstractHandlerMapping getHandlerMapping()

Return a handler mapping with the mapped ViewControllers.

getOrderback to summary
protected int getOrder()
getUrlPathHelperback to summary
protected UrlPathHelper getUrlPathHelper()
Annotations
@Nullable
isPreserveReceiveOrderback to summary
protected boolean isPreserveReceiveOrder()
setApplicationContextback to summary
protected void setApplicationContext(ApplicationContext applicationContext)
setErrorHandlerback to summary
public WebMvcStompEndpointRegistry setErrorHandler(StompSubProtocolErrorHandler errorHandler)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setErrorHandler.

Doc from org.springframework.web.socket.config.annotation.StompEndpointRegistry.setErrorHandler.

Configure a handler for customizing or handling STOMP ERROR frames to clients.

Parameters
errorHandler:StompSubProtocolErrorHandler

the error handler

Annotations
@Override
setOrderback to summary
public void setOrder(int order)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setOrder.

Set the order for the resulting org.springframework.web.servlet.HandlerMapping relative to other handler mappings configured in Spring MVC.

The default value is 1.

Annotations
@Override
setPreserveReceiveOrderback to summary
public WebMvcStompEndpointRegistry setPreserveReceiveOrder(boolean preserveReceiveOrder)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setPreserveReceiveOrder.

Doc from org.springframework.web.socket.config.annotation.StompEndpointRegistry.setPreserveReceiveOrder.

Whether to handle client messages sequentially in the order in which they were received.

By default messages sent to the "clientInboundChannel" may be handled in parallel and not in the same order as they were received because the channel is backed by a ThreadPoolExecutor that in turn does not guarantee processing in order.

When this flag is set to true messages within the same session will be sent to the "clientInboundChannel" one at a time in order to preserve the order in which they were received.

setUrlPathHelperback to summary
public void setUrlPathHelper(UrlPathHelper urlPathHelper)

Implements org.springframework.web.socket.config.annotation.StompEndpointRegistry.setUrlPathHelper.

Set the UrlPathHelper to configure on the HandlerMapping used to map handshake requests.

Annotations
@Override
unwrapSubProtocolWebSocketHandlerback to summary
private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(WebSocketHandler handler)