Class IntegrationWebSocketContainer
java.lang.Object
org.springframework.integration.websocket.IntegrationWebSocketContainer
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
- Direct Known Subclasses:
ClientWebSocketContainer,ServerWebSocketContainer
public abstract class IntegrationWebSocketContainer
extends Object
implements org.springframework.beans.factory.DisposableBean
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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprotected final org.apache.commons.logging.Logprotected final org.springframework.web.socket.WebSocketHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSupportedProtocols(String... protocols) voidcloseSession(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus) voiddestroy()org.springframework.web.socket.WebSocketSessiongetSession(String sessionId) org.springframework.web.socket.WebSocketHandlervoidsetMessageListener(WebSocketListener messageListener) voidsetSendBufferSizeLimit(int sendBufferSizeLimit) voidsetSendTimeLimit(int sendTimeLimit) voidsetSupportedProtocols(String... protocols)
-
Field Details
-
DEFAULT_SEND_TIME_LIMIT
public static final int DEFAULT_SEND_TIME_LIMIT- See Also:
-
DEFAULT_SEND_BUFFER_SIZE
public static final int DEFAULT_SEND_BUFFER_SIZE- See Also:
-
logger
protected final org.apache.commons.logging.Log logger -
webSocketHandler
protected final org.springframework.web.socket.WebSocketHandler webSocketHandler -
sessions
-
-
Constructor Details
-
IntegrationWebSocketContainer
public IntegrationWebSocketContainer()
-
-
Method Details
-
setSendTimeLimit
public void setSendTimeLimit(int sendTimeLimit) -
setSendBufferSizeLimit
public void setSendBufferSizeLimit(int sendBufferSizeLimit) -
setMessageListener
-
setSupportedProtocols
-
addSupportedProtocols
-
getWebSocketHandler
public org.springframework.web.socket.WebSocketHandler getWebSocketHandler() -
getSubProtocols
-
getSessions
-
getSession
-
closeSession
public void closeSession(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus closeStatus) throws Exception - Throws:
Exception
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-