org.springframework.web.socket.server.support

## Class WebSocketHandlerMapping

- java.lang.Object
- - org.springframework.context.support.ApplicationObjectSupport
  - - org.springframework.web.context.support.WebApplicationObjectSupport
    - - org.springframework.web.servlet.handler.AbstractHandlerMapping
      - - org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
        - - org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
          - - org.springframework.web.socket.server.support.WebSocketHandlerMapping

All Implemented Interfaces:
  org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.handler.MatchableHandlerMapping, org.springframework.web.servlet.HandlerMapping

    public class WebSocketHandlerMapping
    extends org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
    implements org.springframework.context.SmartLifecycle

An extension of `SimpleUrlHandlerMapping` that is also a `SmartLifecycle` container and propagates start and stop calls to any handlers that implement `Lifecycle`. The handlers are typically expected to be `WebSocketHttpRequestHandler` or `SockJsHttpRequestHandler`.

Since:
  4.2
Author:
  Rossen Stoyanchev

### Field Summary

### Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

`logger`

### Fields inherited from interface org.springframework.context.SmartLifecycle

`DEFAULT_PHASE`

### Fields inherited from interface org.springframework.web.servlet.HandlerMapping

`BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

### Constructor Summary

Constructors
Constructor and Description
`WebSocketHandlerMapping()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `initServletContext(ServletContext servletContext)`
`boolean` `isRunning()`
`void` `start()`
`void` `stop()`

### Methods inherited from class org.springframework.web.servlet.handler.SimpleUrlHandlerMapping

`getUrlMap, initApplicationContext, registerHandlers, setMappings, setUrlMap`

### Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping

`buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler`

### Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping

`adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, hasCorsConfigurationSource, initInterceptors, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper`

### Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

`getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext`

### Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

`getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext`

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

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

### Methods inherited from interface org.springframework.context.SmartLifecycle

`getPhase, isAutoStartup, stop`

### Methods inherited from interface org.springframework.web.servlet.HandlerMapping

`getHandler`

### Constructor Detail

#### WebSocketHandlerMapping

    public WebSocketHandlerMapping()

### Method Detail

#### initServletContext

    protected void initServletContext(ServletContext servletContext)

Overrides:
  `initServletContext` in class `org.springframework.web.context.support.WebApplicationObjectSupport`

#### start

    public void start()

Specified by:
  `start` in interface `org.springframework.context.Lifecycle`

#### stop

    public void stop()

Specified by:
  `stop` in interface `org.springframework.context.Lifecycle`

#### isRunning

    public boolean isRunning()

Specified by:
  `isRunning` in interface `org.springframework.context.Lifecycle`