org.springframework.web.socket.config.annotation

## Class ServletWebSocketHandlerRegistry

- java.lang.Object
- - org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry

All Implemented Interfaces:
  WebSocketHandlerRegistry

    public class ServletWebSocketHandlerRegistry
    extends Object
    implements WebSocketHandlerRegistry

`WebSocketHandlerRegistry` with Spring MVC handler mappings for the handshake requests.

Since:
  4.0
Author:
  Rossen Stoyanchev

### Constructor Summary

Constructors
Constructor and Description
`ServletWebSocketHandlerRegistry()`

### Method Summary

All Methods Instance Methods Concrete Methods
`WebSocketHandlerRegistration` `addHandler(WebSocketHandler handler, String... paths)` Configure a WebSocketHandler at the specified URL paths.
`org.springframework.web.servlet.handler.AbstractHandlerMapping` `getHandlerMapping()`
`int` `getOrder()`
`org.springframework.web.util.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(org.springframework.scheduling.TaskScheduler scheduler)` Provide the TaskScheduler to use for SockJS endpoints for which a task scheduler has not been explicitly registered.
`void` `setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)` Set the UrlPathHelper to configure on the `SimpleUrlHandlerMapping` used to map handshake requests.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServletWebSocketHandlerRegistry

    public ServletWebSocketHandlerRegistry()

### Method Detail

#### addHandler

    public WebSocketHandlerRegistration addHandler(WebSocketHandler handler,
                                                   String... paths)

Description copied from interface: `WebSocketHandlerRegistry`
Configure a WebSocketHandler at the specified URL paths.

Specified by:
  `addHandler` in interface `WebSocketHandlerRegistry`

#### setOrder

    public void setOrder(int order)

Set the order for the resulting `SimpleUrlHandlerMapping` relative to other handler mappings configured in Spring MVC.

The default value is 1.

#### getOrder

    public int getOrder()

#### setUrlPathHelper

    public void setUrlPathHelper(@Nullable
                                 org.springframework.web.util.UrlPathHelper urlPathHelper)

Set the UrlPathHelper to configure on the `SimpleUrlHandlerMapping` used to map handshake requests.

#### getUrlPathHelper

    @Nullable
    public org.springframework.web.util.UrlPathHelper getUrlPathHelper()

#### requiresTaskScheduler

    protected boolean requiresTaskScheduler()

Whether there are any endpoint SockJS registrations without a TaskScheduler. This method should be invoked just before `getHandlerMapping()` to allow for registrations to be made first.

#### setTaskScheduler

    protected void setTaskScheduler(org.springframework.scheduling.TaskScheduler scheduler)

Provide the TaskScheduler to use for SockJS endpoints for which a task scheduler has not been explicitly registered. This method must be called prior to `getHandlerMapping()`.

#### getHandlerMapping

    public org.springframework.web.servlet.handler.AbstractHandlerMapping getHandlerMapping()