Package org.springframework.http.client
Class HttpComponentsAsyncClientHttpRequestFactory
- java.lang.Object
- org.springframework.http.client.HttpComponentsClientHttpRequestFactory
- org.springframework.http.client.HttpComponentsAsyncClientHttpRequestFactory
- All Implemented Interfaces:
DisposableBean
,InitializingBean
,AsyncClientHttpRequestFactory
,ClientHttpRequestFactory
@Deprecated public class HttpComponentsAsyncClientHttpRequestFactory extends HttpComponentsClientHttpRequestFactory implements AsyncClientHttpRequestFactory, InitializingBean
Deprecated.as of Spring 5.0, with no direct replacementAsynchronous extension of theHttpComponentsClientHttpRequestFactory
. Uses Apache HttpComponents HttpAsyncClient 4.0 to create requests.- Since:
- 4.0
- Author:
- Arjen Poutsma, Stephane Nicoll
- See Also:
HttpAsyncClient
Constructor Summary
Constructors Constructor Description HttpComponentsAsyncClientHttpRequestFactory()
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with a defaultHttpAsyncClient
andHttpClient
.HttpComponentsAsyncClientHttpRequestFactory(HttpClient httpClient, org.apache.http.nio.client.HttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpClient
andHttpAsyncClient
instances.HttpComponentsAsyncClientHttpRequestFactory(CloseableHttpClient httpClient, org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpClient
andCloseableHttpAsyncClient
instances.HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpAsyncClient
instance and a defaultHttpClient
.HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.nio.client.HttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpAsyncClient
instance and a defaultHttpClient
.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterPropertiesSet()
Deprecated.Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.AsyncClientHttpRequest
createAsyncRequest(URI uri, HttpMethod httpMethod)
Deprecated.Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.void
destroy()
Deprecated.Shutdown hook that closes the underlyingClientConnectionManager
's connection pool, if any.org.apache.http.nio.client.HttpAsyncClient
getAsyncClient()
Deprecated.Return theHttpAsyncClient
used for synchronous execution.org.apache.http.impl.nio.client.CloseableHttpAsyncClient
getHttpAsyncClient()
Deprecated.as of 4.3.10, in favor ofgetAsyncClient()
void
setAsyncClient(org.apache.http.nio.client.HttpAsyncClient asyncClient)
Deprecated.Set theHttpAsyncClient
used for synchronous execution.void
setHttpAsyncClient(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
Deprecated.as of 4.3.10, in favor ofsetAsyncClient(HttpAsyncClient)
Methods inherited from class org.springframework.http.client.HttpComponentsClientHttpRequestFactory
createHttpContext, createHttpUriRequest, createRequest, createRequestConfig, getHttpClient, mergeRequestConfig, postProcessHttpRequest, setBufferRequestBody, setConnectionRequestTimeout, setConnectTimeout, setHttpClient, setHttpContextFactory, setReadTimeout
Constructor Detail
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory()
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with a defaultHttpAsyncClient
andHttpClient
.
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.nio.client.HttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpAsyncClient
instance and a defaultHttpClient
.- Parameters:
asyncClient
- the HttpAsyncClient instance to use for this request factory- Since:
- 4.3.10
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpAsyncClient
instance and a defaultHttpClient
.- Parameters:
asyncClient
- the CloseableHttpAsyncClient instance to use for this request factory
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(HttpClient httpClient, org.apache.http.nio.client.HttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpClient
andHttpAsyncClient
instances.- Parameters:
httpClient
- the HttpClient instance to use for this request factoryasyncClient
- the HttpAsyncClient instance to use for this request factory- Since:
- 4.3.10
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(CloseableHttpClient httpClient, org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
Deprecated.Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpClient
andCloseableHttpAsyncClient
instances.- Parameters:
httpClient
- the CloseableHttpClient instance to use for this request factoryasyncClient
- the CloseableHttpAsyncClient instance to use for this request factory
Method Detail
setAsyncClient
public void setAsyncClient(org.apache.http.nio.client.HttpAsyncClient asyncClient)
Deprecated.Set theHttpAsyncClient
used for synchronous execution.- Since:
- 4.3.10
- See Also:
HttpComponentsClientHttpRequestFactory.setHttpClient(HttpClient)
getAsyncClient
public org.apache.http.nio.client.HttpAsyncClient getAsyncClient()
Deprecated.Return theHttpAsyncClient
used for synchronous execution.- Since:
- 4.3.10
- See Also:
HttpComponentsClientHttpRequestFactory.getHttpClient()
setHttpAsyncClient
@Deprecated public void setHttpAsyncClient(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
Deprecated.as of 4.3.10, in favor ofsetAsyncClient(HttpAsyncClient)
Set theCloseableHttpAsyncClient
used for asynchronous execution.
getHttpAsyncClient
@Deprecated public org.apache.http.impl.nio.client.CloseableHttpAsyncClient getHttpAsyncClient()
Deprecated.as of 4.3.10, in favor ofgetAsyncClient()
Return theCloseableHttpAsyncClient
used for asynchronous execution.
afterPropertiesSet
public void afterPropertiesSet()
Deprecated.Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
createAsyncRequest
public AsyncClientHttpRequest createAsyncRequest(URI uri, HttpMethod httpMethod) throws IOException
Deprecated.Description copied from interface:AsyncClientHttpRequestFactory
Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.The returned request can be written to, and then executed by calling
AsyncClientHttpRequest.executeAsync()
.- Specified by:
createAsyncRequest
in interfaceAsyncClientHttpRequestFactory
- Parameters:
uri
- the URI to create a request forhttpMethod
- the HTTP method to execute- Returns:
- the created request
- Throws:
IOException
- in case of I/O errors
destroy
public void destroy() throws Exception
Deprecated.Description copied from class:HttpComponentsClientHttpRequestFactory
Shutdown hook that closes the underlyingClientConnectionManager
's connection pool, if any.- Specified by:
destroy
in interfaceDisposableBean
- Overrides:
destroy
in classHttpComponentsClientHttpRequestFactory
- Throws:
Exception
- in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources as well.