org.springframework.web.socket.config.annotation

## Class AbstractWebSocketHandlerRegistration<M>

- java.lang.Object
- - org.springframework.web.socket.config.annotation.AbstractWebSocketHandlerRegistration<M>

- All Implemented Interfaces:
    WebSocketHandlerRegistration
  Direct Known Subclasses:
    ServletWebSocketHandlerRegistration

      public abstract class AbstractWebSocketHandlerRegistration<M>
      extends Object
      implements WebSocketHandlerRegistration

  Base class for `WebSocketHandlerRegistration`s that gathers all the configuration options but allows sub-classes to put together the actual HTTP request mappings.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractWebSocketHandlerRegistration(TaskScheduler defaultTaskScheduler)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `WebSocketHandlerRegistration` | `addHandler(WebSocketHandler handler, String... paths)` Add more handlers that will share the same configuration (interceptors, SockJS config, etc)
    `WebSocketHandlerRegistration` | `addInterceptors(HandshakeInterceptor... interceptors)` Configure interceptors for the handshake request.
    `protected abstract void` | `addSockJsServiceMapping(M mappings, SockJsService sockJsService, WebSocketHandler handler, String pathPattern)`
    `protected abstract void` | `addWebSocketHandlerMapping(M mappings, WebSocketHandler wsHandler, HandshakeHandler handshakeHandler, HandshakeInterceptor[] interceptors, String path)`
    `protected abstract M` | `createMappings()`
    `HandshakeHandler` | `getHandshakeHandler()`
    `protected HandshakeInterceptor[]` | `getInterceptors()`
    `M` | `getMappings()`
    `WebSocketHandlerRegistration` | `setHandshakeHandler(HandshakeHandler handshakeHandler)` Configure the HandshakeHandler to use.
    `void` | `setInterceptors(HandshakeInterceptor[] interceptors)`
    `SockJsServiceRegistration` | `withSockJS()` Enable SockJS fallback options.

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

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

- - ### Constructor Detail

    - #### AbstractWebSocketHandlerRegistration

          public AbstractWebSocketHandlerRegistration(TaskScheduler defaultTaskScheduler)

  - ### Method Detail

    - #### addHandler

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

      Description copied from interface: `WebSocketHandlerRegistration`
      Add more handlers that will share the same configuration (interceptors, SockJS config, etc)
      Specified by:
        `addHandler` in interface `WebSocketHandlerRegistration`

    - #### setHandshakeHandler

          public WebSocketHandlerRegistration setHandshakeHandler(HandshakeHandler handshakeHandler)

      Description copied from interface: `WebSocketHandlerRegistration`
      Configure the HandshakeHandler to use.
      Specified by:
        `setHandshakeHandler` in interface `WebSocketHandlerRegistration`

    - #### getHandshakeHandler

          public HandshakeHandler getHandshakeHandler()

    - #### addInterceptors

          public WebSocketHandlerRegistration addInterceptors(HandshakeInterceptor... interceptors)

      Description copied from interface: `WebSocketHandlerRegistration`
      Configure interceptors for the handshake request.
      Specified by:
        `addInterceptors` in interface `WebSocketHandlerRegistration`

    - #### getInterceptors

          protected HandshakeInterceptor[] getInterceptors()

    - #### setInterceptors

          public void setInterceptors(HandshakeInterceptor[] interceptors)

      Parameters:
        `interceptors` - the interceptors to set

    - #### withSockJS

          public SockJsServiceRegistration withSockJS()

      Description copied from interface: `WebSocketHandlerRegistration`
      Enable SockJS fallback options.
      Specified by:
        `withSockJS` in interface `WebSocketHandlerRegistration`

    - #### getMappings

          public final M getMappings()

    - #### createMappings

          protected abstract M createMappings()

    - #### addSockJsServiceMapping

          protected abstract void addSockJsServiceMapping(M mappings,
                                                          SockJsService sockJsService,
                                                          WebSocketHandler handler,
                                                          String pathPattern)

    - #### addWebSocketHandlerMapping

          protected abstract void addWebSocketHandlerMapping(M mappings,
                                                             WebSocketHandler wsHandler,
                                                             HandshakeHandler handshakeHandler,
                                                             HandshakeInterceptor[] interceptors,
                                                             String path)