Transport that uses a
WebSocketClient.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final Log | |
| private volatile boolean | |
| private final WebSocketClient |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public CompletableFuture | connectAsync(TransportRequest
the transport request request, WebSocketHandler the application handler to delegate lifecycle events to handler)Implements org. Connect the transport. |
| public List | getTransportTypes()
Implements org. Get the SockJS transport types that this transport can be used for. |
| public WebSocketClient | |
| public boolean | isRunning()
Implements org. Check whether this component is currently running. |
| public void | |
| public void | stop()
Implements org. Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. |
| public String |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| webSocketClient | back to summary |
|---|---|
| private final WebSocketClient webSocketClient | |
| WebSocketTransport | back to summary |
|---|---|
| public WebSocketTransport(WebSocketClient webSocketClient) | |
| connectAsync | back to summary |
|---|---|
| public CompletableFuture Implements org. Doc from org. Connect the transport.
| |
| getTransportTypes | back to summary |
|---|---|
| public List Implements org. Doc from org. Get the SockJS transport types that this transport can be used for. In particular since from a client perspective there is no difference
between XHR and XHR streaming, an
| |
| getWebSocketClient | back to summary |
|---|---|
| public WebSocketClient getWebSocketClient() Return the configured | |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicBoolean | |
| private final WebSocketClientSockJsSession |
| Access | Constructor and Description |
|---|---|
| public |
| connected | back to summary |
|---|---|
| private final AtomicBoolean connected | |
| sockJsSession | back to summary |
|---|---|
| private final WebSocketClientSockJsSession sockJsSession | |
| ClientSockJsWebSocketHandler | back to summary |
|---|---|
| public ClientSockJsWebSocketHandler(WebSocketClientSockJsSession session) | |
| afterConnectionClosed | back to summary |
|---|---|
| public void afterConnectionClosed(WebSocketSession webSocketSession, CloseStatus status) throws Exception Overrides org. Implements org. Doc from org. Invoked after the WebSocket connection has been closed by either side, or after a transport error has occurred. Although the session may technically still be open, depending on the underlying implementation, sending messages at this point is discouraged and most likely will not succeed. | |
| afterConnectionEstablished | back to summary |
|---|---|
| public void afterConnectionEstablished(WebSocketSession webSocketSession) throws Exception Overrides org. Implements org. Doc from org. Invoked after WebSocket negotiation has succeeded and the WebSocket connection is opened and ready for use. | |
| handleTextMessage | back to summary |
|---|---|
| public void handleTextMessage(WebSocketSession webSocketSession, TextMessage message) throws Exception Overrides org.
| |
| handleTransportError | back to summary |
|---|---|
| public void handleTransportError(WebSocketSession webSocketSession, Throwable ex) throws Exception Overrides org. Implements org. Doc from org. Handle an error from the underlying WebSocket message transport. | |