public abstract class IntegrationWebSocketContainer extends Object implements ApplicationEventPublisherAware, 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 |
---|---|
protected org.apache.commons.logging.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) |
List<String> |
getSubProtocols() |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setMessageListener(WebSocketListener messageListener) |
void |
setSendBufferSizeLimit(int sendBufferSizeLimit) |
void |
setSendTimeLimit(int sendTimeLimit) |
void |
setSupportedProtocols(String... protocols) |
protected final org.apache.commons.logging.Log logger
protected final WebSocketHandler webSocketHandler
protected final Map<String,WebSocketSession> sessions
public void setSendTimeLimit(int sendTimeLimit)
public void setSendBufferSizeLimit(int sendBufferSizeLimit)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
public void setMessageListener(WebSocketListener messageListener)
public void setSupportedProtocols(String... protocols)
public void addSupportedProtocols(String... protocols)
public WebSocketSession getSession(String sessionId) throws Exception
Exception
public void closeSession(WebSocketSession session, CloseStatus closeStatus) throws Exception
Exception
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception