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(Long timeoutInMillis)
    • getAsyncSendTimeout

      @Nullable public Long getAsyncSendTimeout()
    • setMaxSessionIdleTimeout

      public void setMaxSessionIdleTimeout(Long timeoutInMillis)
    • getMaxSessionIdleTimeout

      @Nullable public Long getMaxSessionIdleTimeout()
    • setMaxTextMessageBufferSize

      public void setMaxTextMessageBufferSize(Integer bufferSize)
    • getMaxTextMessageBufferSize

      @Nullable public Integer getMaxTextMessageBufferSize()
    • setMaxBinaryMessageBufferSize

      public void setMaxBinaryMessageBufferSize(Integer bufferSize)
    • getMaxBinaryMessageBufferSize

      @Nullable public Integer getMaxBinaryMessageBufferSize()
    • setServletContext

      public void setServletContext(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

      @Nullable public 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>