public class RestTemplateXhrTransport extends AbstractXhrTransport implements XhrTransport
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 request,
WebSocketHandler handler,
URI receiveUrl,
HttpHeaders handshakeHeaders,
XhrClientSockJsSession session,
SettableListenableFuture<WebSocketSession> connectFuture) |
ResponseEntity<String> |
executeInfoRequestInternal(URI infoUrl) |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
executeSendRequest, isXhrStreamingDisabled
connect, getTransportTypes
executeInfoRequest
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.
taskExecutor
- the task executor, cannot be null
public TaskExecutor getTaskExecutor()
TaskExecutor
.public ResponseEntity<String> executeInfoRequestInternal(URI infoUrl)
executeInfoRequestInternal
in class AbstractXhrTransport
public ResponseEntity<String> executeSendRequestInternal(URI url, HttpHeaders headers, TextMessage message)
executeSendRequestInternal
in class AbstractXhrTransport
protected void connectInternal(TransportRequest request, WebSocketHandler handler, URI receiveUrl, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture)
connectInternal
in class AbstractXhrTransport