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,
java.net.URI receiveUrl,
org.springframework.http.HttpHeaders handshakeHeaders,
XhrClientSockJsSession session,
org.springframework.util.concurrent.SettableListenableFuture<WebSocketSession> connectFuture) |
protected org.springframework.http.ResponseEntity<java.lang.String> |
executeInfoRequestInternal(java.net.URI infoUrl,
org.springframework.http.HttpHeaders headers) |
org.springframework.http.ResponseEntity<java.lang.String> |
executeSendRequestInternal(java.net.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, getRequestHeaders, getTransportTypes, isXhrStreamingDisabled, setRequestHeaders, setXhrStreamingDisabled, toStringpublic 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, java.net.URI receiveUrl, org.springframework.http.HttpHeaders handshakeHeaders, XhrClientSockJsSession session, org.springframework.util.concurrent.SettableListenableFuture<WebSocketSession> connectFuture)
connectInternal in class AbstractXhrTransportprotected org.springframework.http.ResponseEntity<java.lang.String> executeInfoRequestInternal(java.net.URI infoUrl,
org.springframework.http.HttpHeaders headers)
executeInfoRequestInternal in class AbstractXhrTransportpublic org.springframework.http.ResponseEntity<java.lang.String> executeSendRequestInternal(java.net.URI url,
org.springframework.http.HttpHeaders headers,
TextMessage message)
executeSendRequestInternal in class AbstractXhrTransport