Top Description Inners Fields Constructors Methods
org.springframework.web.socket.config.annotation

public Class WebSocketConfigurationSupport

extends Object
Class Inheritance
Known Direct Subclasses
org.springframework.web.socket.config.annotation.DelegatingWebSocketConfiguration
Imports
org.springframework.beans.factory.DisposableBean, .InitializingBean, org.springframework.beans.factory.annotation.Qualifier, org.springframework.context.annotation.Bean, org.springframework.lang.Nullable, org.springframework.scheduling.TaskScheduler, org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler, org.springframework.util.Assert, org.springframework.web.servlet.HandlerMapping

Configuration support for WebSocket request handling.
Authors
Rossen Stoyanchev, Sebastien Deleuze
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private ServletWebSocketHandlerRegistry

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv WebSocketConfigurationSupport.DefaultSockJsSchedulerContainer
defaultSockJsSchedulerContainer()

A container of the default TaskScheduler to use if none was registered explicitly via SockJsServiceRegistration#setTaskScheduler as follows:

@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {

  public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(myHandler(), "/echo")
            .withSockJS()
            .setTaskScheduler(myScheduler());
  }

  // ...
private ThreadPoolTaskScheduler
initDefaultSockJsScheduler()
References Deprecated ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

private ServletWebSocketHandlerRegistry
protected void
public HandlerMapping
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handlerRegistryback to summary
private ServletWebSocketHandlerRegistry handlerRegistry
Annotations
@Nullable

Constructor Detail

WebSocketConfigurationSupportback to summary
public WebSocketConfigurationSupport()

Method Detail

defaultSockJsSchedulerContainerback to summary
pack-priv WebSocketConfigurationSupport.DefaultSockJsSchedulerContainer defaultSockJsSchedulerContainer()

A container of the default TaskScheduler to use if none was registered explicitly via SockJsServiceRegistration#setTaskScheduler as follows:

@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {

  public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
    registry.addHandler(myHandler(), "/echo")
            .withSockJS()
            .setTaskScheduler(myScheduler());
  }

  // ...
}
Annotations
@Bean
initDefaultSockJsSchedulerback to summary
private ThreadPoolTaskScheduler initDefaultSockJsScheduler()

References Deprecated

ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

initHandlerRegistryback to summary
private ServletWebSocketHandlerRegistry initHandlerRegistry()
registerWebSocketHandlersback to summary
protected void registerWebSocketHandlers(WebSocketHandlerRegistry registry)
webSocketHandlerMappingback to summary
public HandlerMapping webSocketHandlerMapping(WebSocketConfigurationSupport.DefaultSockJsSchedulerContainer schedulerContainer)
Annotations
@Bean
org.springframework.web.socket.config.annotation back to summary

pack-priv Class WebSocketConfigurationSupport.DefaultSockJsSchedulerContainer

extends Object
implements InitializingBean, DisposableBean
Class Inheritance
  • java.lang.Object
  • org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport.DefaultSockJsSchedulerContainer
All Implemented Interfaces
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

Field Summary

Modifier and TypeField and Description
private final ThreadPoolTaskScheduler
scheduler

References Deprecated ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultSockJsSchedulerContainer(ThreadPoolTaskScheduler scheduler)
References Deprecated ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

public void
destroy()

Implements org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

public ThreadPoolTaskScheduler
getScheduler()
References Deprecated ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

schedulerback to summary
private final ThreadPoolTaskScheduler scheduler

References Deprecated

ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@Nullable

Constructor Detail

DefaultSockJsSchedulerContainerback to summary
pack-priv DefaultSockJsSchedulerContainer(ThreadPoolTaskScheduler scheduler)

References Deprecated

ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws Exception

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
Exceptions
Exception:
in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
destroyback to summary
public void destroy() throws Exception

Implements org.springframework.beans.factory.DisposableBean.destroy.

Doc from org.springframework.beans.factory.DisposableBean.destroy.

Invoked by the containing BeanFactory on destruction of a bean.

Annotations
@Override
Exceptions
Exception:
in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources as well.
getSchedulerback to summary
public ThreadPoolTaskScheduler getScheduler()

References Deprecated

ThreadPoolTaskScheduler is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@Nullable