Class IntegrationWebSocketContainer
java.lang.Object
org.springframework.integration.websocket.IntegrationWebSocketContainer
- All Implemented Interfaces:
- DisposableBean
- Direct Known Subclasses:
- ClientWebSocketContainer,- ServerWebSocketContainer
The high-level 'connection factory pattern' contract over low-level Web-Socket
 configuration.
 
 Provides the composition for the internal WebSocketHandler
 implementation, which is used with native Web-Socket containers.
 
 Collects established WebSocketSessions, which can be accessed using
 getSession(String).
 
 Can accept the WebSocketListener to delegate WebSocketSession events
 from the internal IntegrationWebSocketContainer.IntegrationWebSocketHandler.
 
 Supported sub-protocols can be configured, but SubProtocolCapable.getSubProtocols()
 have a precedent.
- Since:
- 4.1
- Author:
- Artem Bilan, Gary Russell, Julian Koch
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intprotected final Lockprotected final Logprotected final Map<String, WebSocketSession> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddSupportedProtocols(String... protocols) voidcloseSession(WebSocketSession session, CloseStatus closeStatus) voiddestroy()getSession(@Nullable String sessionId) voidsetMessageListener(WebSocketListener messageListener) voidsetSendBufferOverflowStrategy(@Nullable ConcurrentWebSocketSessionDecorator.OverflowStrategy overflowStrategy) Set the send buffer overflow strategy.voidsetSendBufferSizeLimit(int sendBufferSizeLimit) voidsetSendTimeLimit(int sendTimeLimit) voidsetSupportedProtocols(String... protocols) protected voidsetWebSocketHandler(WebSocketHandler handler) Replace the defaultWebSocketHandlerwith the one provided here, e.g.
- 
Field Details- 
DEFAULT_SEND_TIME_LIMITpublic static final int DEFAULT_SEND_TIME_LIMIT- See Also:
 
- 
DEFAULT_SEND_BUFFER_SIZEpublic static final int DEFAULT_SEND_BUFFER_SIZE- See Also:
 
- 
logger
- 
lock
- 
sessions
 
- 
- 
Constructor Details- 
IntegrationWebSocketContainerpublic IntegrationWebSocketContainer()
 
- 
- 
Method Details- 
setSendTimeLimitpublic void setSendTimeLimit(int sendTimeLimit) 
- 
setSendBufferSizeLimitpublic void setSendBufferSizeLimit(int sendBufferSizeLimit) 
- 
setSendBufferOverflowStrategypublic void setSendBufferOverflowStrategy(@Nullable ConcurrentWebSocketSessionDecorator.OverflowStrategy overflowStrategy) Set the send buffer overflow strategy.Concurrently generated outbound messages are buffered if sending is slow. This strategy determines the behavior when the buffer has reached the limit configured with setSendBufferSizeLimit(int).- Parameters:
- overflowStrategy- The- ConcurrentWebSocketSessionDecorator.OverflowStrategyto use.
- Since:
- 5.5.19
- See Also:
 
- 
setMessageListener
- 
setSupportedProtocols
- 
addSupportedProtocols
- 
setWebSocketHandlerReplace the defaultWebSocketHandlerwith the one provided here, e.g. via decoration factories.- Parameters:
- handler- the actual- WebSocketHandlerto replace.
- Since:
- 5.5.18
 
- 
getWebSocketHandler
- 
getSubProtocols
- 
getSessions
- 
getSession
- 
closeSession- Throws:
- Exception
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- DisposableBean
 
 
-