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 |
isRunning() |
void |
setAutoStartup(boolean autoStartup) |
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, getSubProtocols, setApplicationEventPublisher, setMessageListener, setSendBufferSizeLimit, setSendTimeLimit, setSupportedProtocols
public 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 org.springframework.web.socket.WebSocketSession getSession(java.lang.String sessionId) throws java.lang.Exception
clientSession
WebSocketSession
.
Independently of provided argument, this method always returns only the
established clientSession
getSession
in class IntegrationWebSocketContainer
sessionId
- the sessionId
. Can be null
.clientSession
, if established.java.lang.Exception
public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle