类 HttpComponentsAsyncClientHttpRequestFactory
- java.lang.Object
- org.springframework.http.client.HttpComponentsClientHttpRequestFactory
- org.springframework.http.client.HttpComponentsAsyncClientHttpRequestFactory
@Deprecated public class HttpComponentsAsyncClientHttpRequestFactory extends HttpComponentsClientHttpRequestFactory implements AsyncClientHttpRequestFactory, InitializingBean
已过时。as of Spring 5.0, with no direct replacementAsynchronous extension of theHttpComponentsClientHttpRequestFactory
. Uses Apache HttpComponents HttpAsyncClient 4.0 to create requests.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Stephane Nicoll
- 另请参阅:
HttpAsyncClient
构造器概要
构造器 构造器 说明 HttpComponentsAsyncClientHttpRequestFactory()
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with a defaultHttpAsyncClient
andHttpClient
.HttpComponentsAsyncClientHttpRequestFactory(HttpClient httpClient, org.apache.http.nio.client.HttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpClient
andHttpAsyncClient
instances.HttpComponentsAsyncClientHttpRequestFactory(CloseableHttpClient httpClient, org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpClient
andCloseableHttpAsyncClient
instances.HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpAsyncClient
instance and a defaultHttpClient
.HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.nio.client.HttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpAsyncClient
instance and a defaultHttpClient
.
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
已过时。Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.AsyncClientHttpRequest
createAsyncRequest(URI uri, HttpMethod httpMethod)
已过时。Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.void
destroy()
已过时。Shutdown hook that closes the underlyingClientConnectionManager
's connection pool, if any.org.apache.http.nio.client.HttpAsyncClient
getAsyncClient()
已过时。Return theHttpAsyncClient
used for synchronous execution.org.apache.http.impl.nio.client.CloseableHttpAsyncClient
getHttpAsyncClient()
已过时。as of 4.3.10, in favor ofgetAsyncClient()
void
setAsyncClient(org.apache.http.nio.client.HttpAsyncClient asyncClient)
已过时。Set theHttpAsyncClient
used for synchronous execution.void
setHttpAsyncClient(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
已过时。as of 4.3.10, in favor ofsetAsyncClient(HttpAsyncClient)
从类继承的方法 org.springframework.http.client.HttpComponentsClientHttpRequestFactory
createHttpContext, createHttpUriRequest, createRequest, createRequestConfig, getHttpClient, mergeRequestConfig, postProcessHttpRequest, setBufferRequestBody, setConnectionRequestTimeout, setConnectTimeout, setHttpClient, setHttpContextFactory, setReadTimeout
构造器详细资料
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory()
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with a defaultHttpAsyncClient
andHttpClient
.
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.nio.client.HttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpAsyncClient
instance and a defaultHttpClient
.- 参数:
asyncClient
- the HttpAsyncClient instance to use for this request factory- 从以下版本开始:
- 4.3.10
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpAsyncClient
instance and a defaultHttpClient
.- 参数:
asyncClient
- the CloseableHttpAsyncClient instance to use for this request factory
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(HttpClient httpClient, org.apache.http.nio.client.HttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenHttpClient
andHttpAsyncClient
instances.- 参数:
httpClient
- the HttpClient instance to use for this request factoryasyncClient
- the HttpAsyncClient instance to use for this request factory- 从以下版本开始:
- 4.3.10
HttpComponentsAsyncClientHttpRequestFactory
public HttpComponentsAsyncClientHttpRequestFactory(CloseableHttpClient httpClient, org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
已过时。Create a new instance of theHttpComponentsAsyncClientHttpRequestFactory
with the givenCloseableHttpClient
andCloseableHttpAsyncClient
instances.- 参数:
httpClient
- the CloseableHttpClient instance to use for this request factoryasyncClient
- the CloseableHttpAsyncClient instance to use for this request factory
方法详细资料
setAsyncClient
public void setAsyncClient(org.apache.http.nio.client.HttpAsyncClient asyncClient)
已过时。Set theHttpAsyncClient
used for synchronous execution.- 从以下版本开始:
- 4.3.10
- 另请参阅:
HttpComponentsClientHttpRequestFactory.setHttpClient(HttpClient)
getAsyncClient
public org.apache.http.nio.client.HttpAsyncClient getAsyncClient()
已过时。Return theHttpAsyncClient
used for synchronous execution.- 从以下版本开始:
- 4.3.10
- 另请参阅:
HttpComponentsClientHttpRequestFactory.getHttpClient()
setHttpAsyncClient
@Deprecated public void setHttpAsyncClient(org.apache.http.impl.nio.client.CloseableHttpAsyncClient asyncClient)
已过时。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()
已过时。as of 4.3.10, in favor ofgetAsyncClient()
Return theCloseableHttpAsyncClient
used for asynchronous execution.
afterPropertiesSet
public void afterPropertiesSet()
已过时。从接口复制的说明: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.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
createAsyncRequest
public AsyncClientHttpRequest createAsyncRequest(URI uri, HttpMethod httpMethod) throws IOException
已过时。从接口复制的说明: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()
.- 指定者:
createAsyncRequest
在接口中AsyncClientHttpRequestFactory
- 参数:
uri
- the URI to create a request forhttpMethod
- the HTTP method to execute- 返回:
- the created request
- 抛出:
IOException
- in case of I/O errors
destroy
public void destroy() throws Exception
已过时。Shutdown hook that closes the underlyingClientConnectionManager
's connection pool, if any.- 指定者:
destroy
在接口中DisposableBean
- 覆盖:
destroy
在类中HttpComponentsClientHttpRequestFactory
- 抛出:
Exception
- in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources as well.