public final class ClientWebSocketContainer extends IntegrationWebSocketContainer implements org.springframework.context.SmartLifecycle
IntegrationWebSocketContainer implementation for the client
Web-Socket connection.
Represent the composition over an internal ConnectionManagerSupport
implementation.
Accepts the clientSession WebSocketSession on
ClientWebSocketContainer.IntegrationWebSocketConnectionManager.openConnection()
event, which can be accessed from this container using getSession(String).
logger, sessions, webSocketHandler| Constructor and Description |
|---|
ClientWebSocketContainer(org.springframework.web.socket.client.WebSocketClient client,
java.lang.String uriTemplate,
java.lang.Object... uriVariables) |
| Modifier and Type | Method and Description |
|---|---|
int |
getPhase() |
org.springframework.web.socket.WebSocketSession |
getSession(java.lang.String sessionId)
Return the
clientSession WebSocketSession. |
boolean |
isAutoStartup() |
boolean |
isConnected()
Return
true if the clientSession is opened. |
boolean |
isRunning() |
void |
setAutoStartup(boolean autoStartup) |
void |
setConnectionTimeout(int connectionTimeout)
Set the connection timeout in seconds; default: 10.
|
void |
setHeaders(org.springframework.http.HttpHeaders headers) |
void |
setHeadersMap(java.util.Map<java.lang.String,java.lang.String> headers) |
void |
setOrigin(java.lang.String origin) |
void |
setPhase(int phase) |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
addSupportedProtocols, closeSession, destroy, getSessions, getSubProtocols, setMessageListener, setSendBufferSizeLimit, setSendTimeLimit, setSupportedProtocolspublic ClientWebSocketContainer(org.springframework.web.socket.client.WebSocketClient client,
java.lang.String uriTemplate,
java.lang.Object... uriVariables)
public void setOrigin(java.lang.String origin)
public void setHeadersMap(java.util.Map<java.lang.String,java.lang.String> headers)
public void setHeaders(org.springframework.http.HttpHeaders headers)
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout - the timeout in seconds.public org.springframework.web.socket.WebSocketSession getSession(java.lang.String sessionId)
clientSession WebSocketSession.
Independently of provided argument, this method always returns only the
established clientSessiongetSession in class IntegrationWebSocketContainersessionId - the sessionId. Can be null.clientSession, if established.public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
public boolean isConnected()
true if the clientSession is opened.WebSocketSession.isOpen() state.public boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic int getPhase()
getPhase in interface org.springframework.context.PhasedgetPhase in interface org.springframework.context.SmartLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecycle