public abstract class IntegrationWebSocketContainer
extends java.lang.Object
implements org.springframework.beans.factory.DisposableBean
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.
WebSocketInboundChannelAdapter,
WebSocketOutboundMessageHandler| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
protected java.util.Map<java.lang.String,org.springframework.web.socket.WebSocketSession> |
sessions |
protected org.springframework.web.socket.WebSocketHandler |
webSocketHandler |
| Constructor and Description |
|---|
IntegrationWebSocketContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSupportedProtocols(java.lang.String... protocols) |
void |
closeSession(org.springframework.web.socket.WebSocketSession session,
org.springframework.web.socket.CloseStatus closeStatus) |
void |
destroy() |
org.springframework.web.socket.WebSocketSession |
getSession(java.lang.String sessionId) |
java.util.Map<java.lang.String,org.springframework.web.socket.WebSocketSession> |
getSessions() |
java.util.List<java.lang.String> |
getSubProtocols() |
void |
setMessageListener(WebSocketListener messageListener) |
void |
setSendBufferSizeLimit(int sendBufferSizeLimit) |
void |
setSendTimeLimit(int sendTimeLimit) |
void |
setSupportedProtocols(java.lang.String... protocols) |
protected final org.apache.commons.logging.Log logger
protected final org.springframework.web.socket.WebSocketHandler webSocketHandler
protected final java.util.Map<java.lang.String,org.springframework.web.socket.WebSocketSession> sessions
public void setSendTimeLimit(int sendTimeLimit)
public void setSendBufferSizeLimit(int sendBufferSizeLimit)
public void setMessageListener(WebSocketListener messageListener)
public void setSupportedProtocols(java.lang.String... protocols)
public void addSupportedProtocols(java.lang.String... protocols)
public java.util.List<java.lang.String> getSubProtocols()
public java.util.Map<java.lang.String,org.springframework.web.socket.WebSocketSession> getSessions()
public org.springframework.web.socket.WebSocketSession getSession(java.lang.String sessionId)
public void closeSession(org.springframework.web.socket.WebSocketSession session,
org.springframework.web.socket.CloseStatus closeStatus)
throws java.lang.Exception
java.lang.Exceptionpublic void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.Exception