类 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
- 所有已实现的接口:
Aware
,BeanNameAware
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
,Ordered
,ServletContextAware
,MatchableHandlerMapping
,HandlerMapping
public class WebSocketHandlerMapping extends SimpleUrlHandlerMapping implements SmartLifecycle
An extension ofSimpleUrlHandlerMapping
that is also aSmartLifecycle
container and propagates start and stop calls to any handlers that implementLifecycle
. The handlers are typically expected to beWebSocketHttpRequestHandler
orSockJsHttpRequestHandler
.- 从以下版本开始:
- 4.2
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 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
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
从接口继承的字段 org.springframework.context.SmartLifecycle
DEFAULT_PHASE
构造器概要
构造器 构造器 说明 WebSocketHandlerMapping()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
initServletContext(ServletContext servletContext)
Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.boolean
isRunning()
Check whether this component is currently running.void
start()
Start this component.void
stop()
Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method.从类继承的方法 org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
getUrlMap, initApplicationContext, registerHandlers, setMappings, setUrlMap
从类继承的方法 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler
从类继承的方法 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
从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.servlet.HandlerMapping
getHandler
从接口继承的方法 org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
构造器详细资料
WebSocketHandlerMapping
public WebSocketHandlerMapping()
方法详细资料
initServletContext
protected void initServletContext(ServletContext servletContext)
从类复制的说明:WebApplicationObjectSupport
Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.The default implementation is empty. Called by
WebApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext)
as well asWebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext)
.- 覆盖:
initServletContext
在类中WebApplicationObjectSupport
- 参数:
servletContext
- the ServletContext that this application object runs in (nevernull
)
start
public void start()
从接口复制的说明:Lifecycle
Start this component.Should not throw an exception if the component is already running.
In the case of a container, this will propagate the start signal to all components that apply.
- 指定者:
start
在接口中Lifecycle
- 另请参阅:
SmartLifecycle.isAutoStartup()
stop
public void stop()
从接口复制的说明:Lifecycle
Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. Consider implementingSmartLifecycle
and itsstop(Runnable)
variant when asynchronous stop behavior is necessary.Note that this stop notification is not guaranteed to come before destruction: On regular shutdown,
Lifecycle
beans will first receive a stop notification before the general destruction callbacks are being propagated; however, on hot refresh during a context's lifetime or on aborted refresh attempts, a given bean's destroy method will be called without any consideration of stop signals upfront.Should not throw an exception if the component is not running (not started yet).
In the case of a container, this will propagate the stop signal to all components that apply.
- 指定者:
stop
在接口中Lifecycle
- 另请参阅:
SmartLifecycle.stop(Runnable)
,DisposableBean.destroy()