Class ClientWebSocketContainer
java.lang.Object
org.springframework.integration.websocket.IntegrationWebSocketContainer
org.springframework.integration.websocket.ClientWebSocketContainer
- All Implemented Interfaces:
- DisposableBean,- Lifecycle,- Phased,- SmartLifecycle
public final class ClientWebSocketContainer
extends IntegrationWebSocketContainer
implements SmartLifecycle
The 
IntegrationWebSocketContainer implementation for the client
 Web-Socket connection.
 
 Represent the composition over an internal ConnectionManagerSupport
 implementation.
 
 Accepts the clientSession WebSocketSession on
 ConnectionManagerSupport.openConnection()
 event, which can be accessed from this container using getSession(String).
- Since:
- 4.1
- Author:
- Artem Bilan, Gary Russell, Christian Tzolov
- 
Field SummaryFields inherited from class org.springframework.integration.websocket.IntegrationWebSocketContainerDEFAULT_SEND_BUFFER_SIZE, DEFAULT_SEND_TIME_LIMIT, lock, logger, sessionsFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionClientWebSocketContainer(WebSocketClient client, String uriTemplate, Object... uriVariables) ClientWebSocketContainer(WebSocketClient client, URI uri) Constructor with a preparedURI.
- 
Method SummaryModifier and TypeMethodDescriptionintgetPhase()getSession(String sessionId) Return theclientSessionWebSocketSession.booleanbooleanReturntrueif theclientSessionis opened.booleanvoidsetAutoStartup(boolean autoStartup) voidsetConnectionTimeout(int connectionTimeout) Set the connection timeout in seconds; default: 10.voidsetHeaders(HttpHeaders headers) voidsetHeadersMap(Map<String, String> headers) voidvoidsetPhase(int phase) voidstart()voidstop()voidMethods inherited from class org.springframework.integration.websocket.IntegrationWebSocketContaineraddSupportedProtocols, closeSession, destroy, getSessions, getSubProtocols, getWebSocketHandler, setMessageListener, setSendBufferOverflowStrategy, setSendBufferSizeLimit, setSendTimeLimit, setSupportedProtocols, setWebSocketHandler
- 
Constructor Details- 
ClientWebSocketContainer
- 
ClientWebSocketContainerConstructor with a preparedURI.- Parameters:
- client- the- WebSocketClientto use.
- uri- the url to connect to
- Since:
- 6.1
 
 
- 
- 
Method Details- 
setOrigin
- 
setHeadersMap
- 
setHeaders
- 
setConnectionTimeoutpublic void setConnectionTimeout(int connectionTimeout) Set the connection timeout in seconds; default: 10.- Parameters:
- connectionTimeout- the timeout in seconds.
- Since:
- 4.2
 
- 
getSessionReturn theclientSessionWebSocketSession. Independently of provided argument, this method always returns only the establishedclientSession- Overrides:
- getSessionin class- IntegrationWebSocketContainer
- Parameters:
- sessionId- the- sessionId. Can be- null.
- Returns:
- the clientSession, if established.
 
- 
setAutoStartuppublic void setAutoStartup(boolean autoStartup) 
- 
setPhasepublic void setPhase(int phase) 
- 
isConnectedpublic boolean isConnected()Returntrueif theclientSessionis opened.- Returns:
- the WebSocketSession.isOpen()state.
- Since:
- 4.2.6
 
- 
isAutoStartuppublic boolean isAutoStartup()- Specified by:
- isAutoStartupin interface- SmartLifecycle
 
- 
getPhasepublic int getPhase()- Specified by:
- getPhasein interface- Phased
- Specified by:
- getPhasein interface- SmartLifecycle
 
- 
isRunning
- 
start
- 
stop
- 
stop- Specified by:
- stopin interface- SmartLifecycle
 
 
-