public class RestTemplateXhrTransport extends AbstractXhrTransport
XhrTransport
implementation that uses a
RestTemplate
.logger, PRELUDE
Constructor and Description |
---|
RestTemplateXhrTransport() |
RestTemplateXhrTransport(RestOperations restTemplate) |
Modifier and Type | Method and Description |
---|---|
protected void |
connectInternal(TransportRequest transportRequest,
WebSocketHandler handler,
URI receiveUrl,
HttpHeaders handshakeHeaders,
XhrClientSockJsSession session,
SettableListenableFuture<WebSocketSession> connectFuture) |
protected ResponseEntity<String> |
executeInfoRequestInternal(URI infoUrl,
HttpHeaders headers) |
ResponseEntity<String> |
executeSendRequestInternal(URI url,
HttpHeaders headers,
TextMessage message) |
RestOperations |
getRestTemplate()
Return the configured
RestTemplate . |
TaskExecutor |
getTaskExecutor()
Return the configured
TaskExecutor . |
void |
setTaskExecutor(TaskExecutor taskExecutor)
Configure the
TaskExecutor to use to execute XHR receive requests. |
connect, executeInfoRequest, executeSendRequest, getRequestHeaders, getTransportTypes, isXhrStreamingDisabled, setRequestHeaders, setXhrStreamingDisabled, toString
public RestTemplateXhrTransport()
public RestTemplateXhrTransport(RestOperations restTemplate)
public RestOperations getRestTemplate()
RestTemplate
.public void setTaskExecutor(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 TaskExecutor getTaskExecutor()
TaskExecutor
.protected void connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URI receiveUrl, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture)
connectInternal
in class AbstractXhrTransport
protected ResponseEntity<String> executeInfoRequestInternal(URI infoUrl, HttpHeaders headers)
executeInfoRequestInternal
in class AbstractXhrTransport
public ResponseEntity<String> executeSendRequestInternal(URI url, HttpHeaders headers, TextMessage message)
executeSendRequestInternal
in class AbstractXhrTransport