spring-framework / org.springframework.remoting.httpinvoker / HttpComponentsHttpInvokerRequestExecutor

HttpComponentsHttpInvokerRequestExecutor

open class HttpComponentsHttpInvokerRequestExecutor : AbstractHttpInvokerRequestExecutor

org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor implementation that uses Apache HttpComponents HttpClient to execute POST requests.

Allows to use a pre-configured org.apache.http.client.HttpClient instance, potentially with authentication, HTTP connection pooling, etc. Also designed for easy subclassing, providing specific template methods.

As of Spring 4.1, this request executor requires Apache HttpComponents 4.3 or higher.

Author
Juergen Hoeller

Author
Stephane Nicoll

Since
3.1

See Also
org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor

Constructors

<init>

HttpComponentsHttpInvokerRequestExecutor()

Create a new instance of the HttpComponentsHttpInvokerRequestExecutor with a default HttpClient that uses a default org.apache.http.impl.conn.PoolingClientConnectionManager.

HttpComponentsHttpInvokerRequestExecutor(httpClient: HttpClient)

Create a new instance of the HttpComponentsClientHttpRequestFactory with the given HttpClient instance.

Functions

getHttpClient

open fun getHttpClient(): HttpClient

Return the HttpClient instance that this request executor uses.

setConnectTimeout

open fun setConnectTimeout(timeout: Int): Unit

Set the connection timeout for the underlying HttpClient. A timeout value of 0 specifies an infinite timeout.

Additional properties can be configured by specifying a RequestConfig instance on a custom HttpClient.

setConnectionRequestTimeout

open fun setConnectionRequestTimeout(connectionRequestTimeout: Int): Unit

Set the timeout in milliseconds used when requesting a connection from the connection manager using the underlying HttpClient. A timeout value of 0 specifies an infinite timeout.

Additional properties can be configured by specifying a RequestConfig instance on a custom HttpClient.

setHttpClient

open fun setHttpClient(httpClient: HttpClient): Unit

Set the HttpClient instance to use for this request executor.

setReadTimeout

open fun setReadTimeout(timeout: Int): Unit

Set the socket read timeout for the underlying HttpClient. A timeout value of 0 specifies an infinite timeout.

Additional properties can be configured by specifying a RequestConfig instance on a custom HttpClient.