Class IntegrationWebSocketContainer

java.lang.Object
org.springframework.integration.websocket.IntegrationWebSocketContainer
All Implemented Interfaces:
DisposableBean
Direct Known Subclasses:
ClientWebSocketContainer, ServerWebSocketContainer

public abstract class IntegrationWebSocketContainer extends Object implements 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
Author:
Artem Bilan, Gary Russell
See Also:
  • Field Details

  • Constructor Details

    • IntegrationWebSocketContainer

      public IntegrationWebSocketContainer()
  • Method Details

    • setSendTimeLimit

      public void setSendTimeLimit(int sendTimeLimit)
    • setSendBufferSizeLimit

      public void setSendBufferSizeLimit(int sendBufferSizeLimit)
    • setMessageListener

      public void setMessageListener(WebSocketListener messageListener)
    • setSupportedProtocols

      public void setSupportedProtocols(String... protocols)
    • addSupportedProtocols

      public void addSupportedProtocols(String... protocols)
    • getWebSocketHandler

      public WebSocketHandler getWebSocketHandler()
    • getSubProtocols

      public List<String> getSubProtocols()
    • getSessions

      public Map<String,WebSocketSession> getSessions()
    • getSession

      public WebSocketSession getSession(String sessionId)
    • closeSession

      public void closeSession(WebSocketSession session, CloseStatus closeStatus) throws Exception
      Throws:
      Exception
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean