ClientHttpRequestFactory.
This class implements SmartLifecycle and can be optionally declared
as a Spring-managed bean in order to support JVM Checkpoint Restore.
| Modifier and Type | Field and Description |
|---|---|
| private static final Function | |
| private Duration | |
| private HttpClient | |
| private final Object | |
| private static final Log | |
| private final Function | |
| private Duration | |
| private final ReactorResourceFactory | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public | ReactorNettyClientRequestFactory()
Create a new instance of the |
| public | ReactorNettyClientRequestFactory(HttpClient
the client to base on httpClient)Create a new instance of the |
| public | ReactorNettyClientRequestFactory(ReactorResourceFactory
the resource factory to obtain the resources from resourceFactory, Function<HttpClient, HttpClient> a mapper for further initialization of the created client mapper)Constructor with externally managed Reactor Netty resources, including
|
| Modifier and Type | Method and Description |
|---|---|
| private static Function | |
| private static HttpClient | |
| public ClientHttpRequest | createRequest(URI
the URI to create a request for uri, HttpMethod the HTTP method to execute httpMethod)Implements org. ClientHttpRequest for the specified URI and HTTP method.
|
| public int | getPhase()
Overrides default org. The default implementation returns |
| public boolean | isAutoStartup()
Overrides default org. true if this Lifecycle component should get
started automatically by the container at the time that the containing
ApplicationContext gets refreshed.
|
| public boolean | isRunning()
Implements org. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | stop()
Implements org. |
| public final void | stop(Runnable callback)
Overrides default org. |
| defaultInitializer | back to summary |
|---|---|
| private static final Function<HttpClient, HttpClient> defaultInitializer | |
| exchangeTimeout | back to summary |
|---|---|
| private Duration exchangeTimeout | |
| httpClient | back to summary |
|---|---|
| private HttpClient httpClient | |
| lifecycleMonitor | back to summary |
|---|---|
| private final Object lifecycleMonitor | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| mapper | back to summary |
|---|---|
| private final Function<HttpClient, HttpClient> mapper
| |
| readTimeout | back to summary |
|---|---|
| private Duration readTimeout | |
| resourceFactory | back to summary |
|---|---|
| private final ReactorResourceFactory resourceFactory
| |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| ReactorNettyClientRequestFactory | back to summary |
|---|---|
| public ReactorNettyClientRequestFactory() Create a new instance of the | |
| ReactorNettyClientRequestFactory | back to summary |
|---|---|
| public ReactorNettyClientRequestFactory(HttpClient httpClient) Create a new instance of the
| |
| ReactorNettyClientRequestFactory | back to summary |
|---|---|
| public ReactorNettyClientRequestFactory(ReactorResourceFactory resourceFactory, Function<HttpClient, HttpClient> mapper) Constructor with externally managed Reactor Netty resources, including
This constructor should be used only when you don't want the client
to participate in the Reactor Netty global resources. By default the
client participates in the Reactor Netty global resources held in
| |
| applyLoopResources | back to summary |
|---|---|
| private static Function | |
| createHttpClient | back to summary |
|---|---|
| private static HttpClient createHttpClient(ReactorResourceFactory resourceFactory, Function<HttpClient, HttpClient> mapper) | |
| createRequest | back to summary |
|---|---|
| public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException Implements org. Doc from org. Create a new The returned request can be written to, and then executed by calling
| |
| getPhase | back to summary |
|---|---|
| public int getPhase() Overrides default org. Doc from org. Return the phase that this lifecycle object is supposed to run in. The default implementation returns
| |
| isAutoStartup | back to summary |
|---|---|
| public boolean isAutoStartup() Overrides default org. Doc from org. Returns A value of The default implementation returns
| |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| setConnectTimeout | back to summary |
|---|---|
| public void setConnectTimeout(int connectTimeout) Set the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout. Default is 30 seconds. | |
| setConnectTimeout | back to summary |
|---|---|
| public void setConnectTimeout(Duration connectTimeout) Set the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout. Default is 30 seconds. | |
| setExchangeTimeout | back to summary |
|---|---|
| public void setExchangeTimeout(long exchangeTimeout) Set the timeout for the HTTP exchange in milliseconds. Default is 30 seconds. | |
| setExchangeTimeout | back to summary |
|---|---|
| public void setExchangeTimeout(Duration exchangeTimeout) Set the timeout for the HTTP exchange. Default is 30 seconds. | |
| setReadTimeout | back to summary |
|---|---|
| public void setReadTimeout(long readTimeout) Set the underlying read timeout in milliseconds. Default is 10 seconds. | |
| setReadTimeout | back to summary |
|---|---|
| public void setReadTimeout(Duration readTimeout) Set the underlying read timeout as Default is 10 seconds. | |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public final void stop(Runnable callback) Overrides default org. Doc from org. Indicates that a Lifecycle component must stop if it is currently running. The provided callback is used by the The The default implementation delegates to
| |