public abstract class IntegrationWebSocketContainer extends Object implements DisposableBean
Provides the composition for the internal WebSocketHandler
implementation, which is used with native Web-Socket containers.
Collects established WebSocketSession
s, 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 |
---|---|
static int |
DEFAULT_SEND_BUFFER_SIZE |
static int |
DEFAULT_SEND_TIME_LIMIT |
protected Log |
logger |
protected Map<String,WebSocketSession> |
sessions |
protected WebSocketHandler |
webSocketHandler |
Constructor and Description |
---|
IntegrationWebSocketContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addSupportedProtocols(String... protocols) |
void |
closeSession(WebSocketSession session,
CloseStatus closeStatus) |
void |
destroy() |
WebSocketSession |
getSession(String sessionId) |
Map<String,WebSocketSession> |
getSessions() |
List<String> |
getSubProtocols() |
void |
setMessageListener(WebSocketListener messageListener) |
void |
setSendBufferSizeLimit(int sendBufferSizeLimit) |
void |
setSendTimeLimit(int sendTimeLimit) |
void |
setSupportedProtocols(String... protocols) |
public static final int DEFAULT_SEND_TIME_LIMIT
public static final int DEFAULT_SEND_BUFFER_SIZE
protected final Log logger
protected final WebSocketHandler webSocketHandler
protected final Map<String,WebSocketSession> sessions
public void setSendTimeLimit(int sendTimeLimit)
public void setSendBufferSizeLimit(int sendBufferSizeLimit)
public void setMessageListener(WebSocketListener messageListener)
public void setSupportedProtocols(String... protocols)
public void addSupportedProtocols(String... protocols)
public Map<String,WebSocketSession> getSessions()
public WebSocketSession getSession(String sessionId)
public void closeSession(WebSocketSession session, CloseStatus closeStatus) throws Exception
Exception
public void destroy()
destroy
in interface DisposableBean