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
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Class<?>
boolean
void
setAsyncSendTimeout
(Long timeoutInMillis) void
setMaxBinaryMessageBufferSize
(Integer bufferSize) void
setMaxSessionIdleTimeout
(Long timeoutInMillis) void
setMaxTextMessageBufferSize
(Integer bufferSize) void
setServletContext
(ServletContext servletContext)
-
Constructor Details
-
ServletServerContainerFactoryBean
public ServletServerContainerFactoryBean()
-
-
Method Details
-
setAsyncSendTimeout
-
getAsyncSendTimeout
-
setMaxSessionIdleTimeout
-
getMaxSessionIdleTimeout
-
setMaxTextMessageBufferSize
-
getMaxTextMessageBufferSize
-
setMaxBinaryMessageBufferSize
-
getMaxBinaryMessageBufferSize
-
setServletContext
- Specified by:
setServletContext
in interfaceorg.springframework.web.context.ServletContextAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<WebSocketContainer>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<WebSocketContainer>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<WebSocketContainer>
-