类 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
,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, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 WebSocketHandlerMapping()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
getPhase()
Return the phase value of this object.protected void
initServletContext(ServletContext servletContext)
Subclasses may override this for custom initialization based on the ServletContext that this application object runs in.boolean
isAutoStartup()
Returnstrue
if thisLifecycle
component should get started automatically by the container at the time that the containingApplicationContext
gets refreshed.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.void
stop(Runnable callback)
Indicates that a Lifecycle component must stop if it is currently running.从类继承的方法 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, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurations, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initInterceptors, setAlwaysUseFullPath, setCorsConfigurations, 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, requiredContextClass, setApplicationContext
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.servlet.HandlerMapping
getHandler
构造器详细资料
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
)
isAutoStartup
public boolean isAutoStartup()
从接口复制的说明:SmartLifecycle
Returnstrue
if thisLifecycle
component should get started automatically by the container at the time that the containingApplicationContext
gets refreshed.A value of
false
indicates that the component is intended to be started through an explicitLifecycle.start()
call instead, analogous to a plainLifecycle
implementation.
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()
stop
public void stop(Runnable callback)
从接口复制的说明:SmartLifecycle
Indicates that a Lifecycle component must stop if it is currently running.The provided callback is used by the
LifecycleProcessor
to support an ordered, and potentially concurrent, shutdown of all components having a common shutdown order value. The callback must be executed after theSmartLifecycle
component does indeed stop.The
LifecycleProcessor
will call only this variant of thestop
method; i.e.Lifecycle.stop()
will not be called forSmartLifecycle
implementations unless explicitly delegated to within the implementation of this method.- 指定者:
stop
在接口中SmartLifecycle
- 另请参阅:
Lifecycle.stop()
,Phased.getPhase()