|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.http.client.HttpComponentsClientHttpRequestFactory
public class HttpComponentsClientHttpRequestFactory
ClientHttpRequestFactory implementation that uses
Apache HttpClient to create requests.
Allows to use a pre-configured HttpClient instance -
potentially with authentication, HTTP connection pooling, etc.
SimpleClientHttpRequestFactory| Constructor Summary | |
|---|---|
HttpComponentsClientHttpRequestFactory()
Create a new instance of the HttpComponentsClientHttpRequestFactory with a default
HttpClient that uses a default MultiThreadedHttpConnectionManager. |
|
HttpComponentsClientHttpRequestFactory(org.apache.http.client.HttpClient httpClient)
Create a new instance of the HttpComponentsHttpRequestFactory with the given
HttpClient instance. |
|
| Method Summary | |
|---|---|
protected org.apache.http.client.methods.HttpUriRequest |
createHttpRequest(HttpMethod httpMethod,
java.net.URI uri)
Create a HttpComponents HttpUrlRequest object for the given HTTP method and URI specification. |
ClientHttpRequest |
createRequest(java.net.URI uri,
HttpMethod httpMethod)
|
void |
destroy()
Shutdown hook that closes the underlying ClientConnectionManager's
connection pool, if any. |
org.apache.http.client.HttpClient |
getHttpClient()
Return the HttpClient used by this factory. |
protected void |
postProcessHttpRequest(org.apache.http.client.methods.HttpUriRequest httpRequest)
Template method that allows for manipulating the HttpUriRequest
before it is returned as part of a HttpComponentsClientHttpRequest. |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
Set the HttpClient used by this factory. |
void |
setReadTimeout(int timeout)
Set the socket read timeout for the underlying HttpClient. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpComponentsClientHttpRequestFactory()
HttpComponentsClientHttpRequestFactory with a default
HttpClient that uses a default MultiThreadedHttpConnectionManager.
public HttpComponentsClientHttpRequestFactory(org.apache.http.client.HttpClient httpClient)
HttpComponentsHttpRequestFactory with the given
HttpClient instance.
httpClient - the HttpClient instance to use for this factory| Method Detail |
|---|
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
HttpClient used by this factory.
public org.apache.http.client.HttpClient getHttpClient()
HttpClient used by this factory.
public void setReadTimeout(int timeout)
timeout - the timeout value in millisecondsHttpParams.setIntParameter(String, int)
public ClientHttpRequest createRequest(java.net.URI uri,
HttpMethod httpMethod)
throws java.io.IOException
createRequest in interface ClientHttpRequestFactoryjava.io.IOException
protected org.apache.http.client.methods.HttpUriRequest createHttpRequest(HttpMethod httpMethod,
java.net.URI uri)
httpMethod - the HTTP methoduri - the URI
protected void postProcessHttpRequest(org.apache.http.client.methods.HttpUriRequest httpRequest)
HttpUriRequest
before it is returned as part of a HttpComponentsClientHttpRequest.
The default implementation is empty.
httpMethod - the Commons HTTP method object to processpublic void destroy()
ClientConnectionManager's
connection pool, if any.
destroy in interface DisposableBean
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||