Class ServletServerContainerFactoryBean

java.lang.Object
org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.FactoryBean<WebSocketContainer>, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware

public class ServletServerContainerFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<WebSocketContainer>, org.springframework.web.context.ServletContextAware, org.springframework.beans.factory.InitializingBean
A FactoryBean for configuring ServerContainer. Since there is usually only one ServerContainer instance accessible under a well-known jakarta.servlet.ServletContext attribute, simply declaring this FactoryBean and using its setters allows for configuring the ServerContainer through Spring configuration.

This is useful even if the ServerContainer is not injected into any other bean within the Spring application context. For example, an application can configure a DefaultHandshakeHandler, a SockJsService, or ServerEndpointExporter, and separately declare this FactoryBean in order to customize the properties of the (one and only) ServerContainer instance.

Since:
4.0
Author:
Rossen Stoyanchev, Sam Brannen
  • Constructor Details

    • ServletServerContainerFactoryBean

      public ServletServerContainerFactoryBean()
  • Method Details

    • setAsyncSendTimeout

      public void setAsyncSendTimeout(@Nullable Long timeoutInMillis)
    • getAsyncSendTimeout

      public @Nullable Long getAsyncSendTimeout()
    • setMaxSessionIdleTimeout

      public void setMaxSessionIdleTimeout(@Nullable Long timeoutInMillis)
    • getMaxSessionIdleTimeout

      public @Nullable Long getMaxSessionIdleTimeout()
    • setMaxTextMessageBufferSize

      public void setMaxTextMessageBufferSize(@Nullable Integer bufferSize)
    • getMaxTextMessageBufferSize

      public @Nullable Integer getMaxTextMessageBufferSize()
    • setMaxBinaryMessageBufferSize

      public void setMaxBinaryMessageBufferSize(@Nullable Integer bufferSize)
    • getMaxBinaryMessageBufferSize

      public @Nullable Integer getMaxBinaryMessageBufferSize()
    • setServletContext

      public void setServletContext(@Nullable ServletContext servletContext)
      Specified by:
      setServletContext in interface org.springframework.web.context.ServletContextAware
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getObject

      public @Nullable ServerContainer getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<WebSocketContainer>
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<WebSocketContainer>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean<WebSocketContainer>