public class RestTemplateXhrTransport extends AbstractXhrTransport
XhrTransport implementation that uses a
RestTemplate.logger, PRELUDE| Constructor and Description |
|---|
RestTemplateXhrTransport() |
RestTemplateXhrTransport(org.springframework.web.client.RestOperations restTemplate) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
connectInternal(TransportRequest transportRequest,
WebSocketHandler handler,
URI receiveUrl,
org.springframework.http.HttpHeaders handshakeHeaders,
XhrClientSockJsSession session,
org.springframework.util.concurrent.SettableListenableFuture<WebSocketSession> connectFuture) |
protected org.springframework.http.ResponseEntity<String> |
executeInfoRequestInternal(URI infoUrl,
org.springframework.http.HttpHeaders headers) |
org.springframework.http.ResponseEntity<String> |
executeSendRequestInternal(URI url,
org.springframework.http.HttpHeaders headers,
TextMessage message) |
org.springframework.web.client.RestOperations |
getRestTemplate()
Return the configured
RestTemplate. |
org.springframework.core.task.TaskExecutor |
getTaskExecutor()
Return the configured
TaskExecutor. |
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Configure the
TaskExecutor to use to execute XHR receive requests. |
connect, executeInfoRequest, executeSendRequest, getTransportTypes, isXhrStreamingDisabled, setXhrStreamingDisabledpublic RestTemplateXhrTransport()
public RestTemplateXhrTransport(org.springframework.web.client.RestOperations restTemplate)
public org.springframework.web.client.RestOperations getRestTemplate()
RestTemplate.public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
TaskExecutor to use to execute XHR receive requests.
By default SimpleAsyncTaskExecutor is configured which creates a new thread every
time the transports connects.
public org.springframework.core.task.TaskExecutor getTaskExecutor()
TaskExecutor.protected void connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URI receiveUrl, org.springframework.http.HttpHeaders handshakeHeaders, XhrClientSockJsSession session, org.springframework.util.concurrent.SettableListenableFuture<WebSocketSession> connectFuture)
connectInternal in class AbstractXhrTransportprotected org.springframework.http.ResponseEntity<String> executeInfoRequestInternal(URI infoUrl, org.springframework.http.HttpHeaders headers)
executeInfoRequestInternal in class AbstractXhrTransportpublic org.springframework.http.ResponseEntity<String> executeSendRequestInternal(URI url, org.springframework.http.HttpHeaders headers, TextMessage message)
executeSendRequestInternal in class AbstractXhrTransport