spring-framework / org.springframework.http.client / HttpComponentsAsyncClientHttpRequestFactory

HttpComponentsAsyncClientHttpRequestFactory

open class HttpComponentsAsyncClientHttpRequestFactory : HttpComponentsClientHttpRequestFactory, AsyncClientHttpRequestFactory, InitializingBean

Asynchronous extension of the HttpComponentsClientHttpRequestFactory. Uses Apache HttpComponents HttpAsyncClient 4.0 to create requests.

Author
Arjen Poutsma

Author
Stephane Nicoll

Since
4.0

See Also
HttpAsyncClient

Constructors

<init>

HttpComponentsAsyncClientHttpRequestFactory()

Create a new instance of the HttpComponentsAsyncClientHttpRequestFactory with a default HttpAsyncClient and HttpClient.

HttpComponentsAsyncClientHttpRequestFactory(asyncClient: HttpAsyncClient)

Create a new instance of the HttpComponentsAsyncClientHttpRequestFactory with the given HttpAsyncClient instance and a default HttpClient.

HttpComponentsAsyncClientHttpRequestFactory(asyncClient: CloseableHttpAsyncClient)

Create a new instance of the HttpComponentsAsyncClientHttpRequestFactory with the given CloseableHttpAsyncClient instance and a default HttpClient.

HttpComponentsAsyncClientHttpRequestFactory(httpClient: HttpClient, asyncClient: HttpAsyncClient)

Create a new instance of the HttpComponentsAsyncClientHttpRequestFactory with the given HttpClient and HttpAsyncClient instances.

HttpComponentsAsyncClientHttpRequestFactory(httpClient: CloseableHttpClient, asyncClient: CloseableHttpAsyncClient)

Create a new instance of the HttpComponentsAsyncClientHttpRequestFactory with the given CloseableHttpClient and CloseableHttpAsyncClient instances.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

createAsyncRequest

open fun createAsyncRequest(uri: URI, httpMethod: HttpMethod): AsyncClientHttpRequest

destroy

open fun destroy(): Unit

getAsyncClient

open fun getAsyncClient(): HttpAsyncClient

Return the HttpAsyncClient used for synchronous execution.

getHttpAsyncClient

open fun getHttpAsyncClient(): CloseableHttpAsyncClient

Return the CloseableHttpAsyncClient used for asynchronous execution.

setAsyncClient

open fun setAsyncClient(asyncClient: HttpAsyncClient): Unit

Set the HttpAsyncClient used for synchronous execution.

setHttpAsyncClient

open fun setHttpAsyncClient(asyncClient: CloseableHttpAsyncClient): Unit

Set the CloseableHttpAsyncClient used for asynchronous execution.