Interface ClientHttpConnectorBuilder<T extends org.springframework.http.client.reactive.ClientHttpConnector>
- Type Parameters:
T- theClientHttpConnectortype
- All Known Implementing Classes:
HttpComponentsClientHttpConnectorBuilder,JdkClientHttpConnectorBuilder,JettyClientHttpConnectorBuilder,ReactorClientHttpConnectorBuilder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ClientHttpConnectorBuilder<T extends org.springframework.http.client.reactive.ClientHttpConnector>
Interface used to build a fully configured
ClientHttpConnector. Builders for
Reactor, Jetty, Apache
HTTP Components and JDK can be obtained using the factory methods on
this interface. The of(Class) method may be used to instantiate based on the
connector type.- Since:
- 3.5.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault Tbuild()Build a default configuredClientHttpConnectorBuilder.build(ClientHttpConnectorSettings settings) Build a fully configuredClientHttpConnector, applying the givensettingsif they are provided.static ClientHttpConnectorBuilder<? extends org.springframework.http.client.reactive.ClientHttpConnector>detect()Detect the most suitableClientHttpConnectorBuilderbased on the classpath.static ClientHttpConnectorBuilder<? extends org.springframework.http.client.reactive.ClientHttpConnector>detect(ClassLoader classLoader) Detect the most suitableClientHttpConnectorBuilderbased on the classpath.Return aHttpComponentsClientHttpConnectorBuilderthat can be used to build aHttpComponentsClientHttpConnector.jdk()Return aJdkClientHttpConnectorBuilderthat can be used to build aJdkClientHttpConnector.jetty()Return aJettyClientHttpConnectorBuilderthat can be used to build aJettyClientHttpConnector.static <T extends org.springframework.http.client.reactive.ClientHttpConnector>
ClientHttpConnectorBuilder<T>Return a newClientHttpConnectorBuilderfor the givenrequestFactoryType.reactor()Return aReactorClientHttpConnectorBuilderthat can be used to build aReactorClientHttpConnector.default ClientHttpConnectorBuilder<T>withCustomizer(Consumer<T> customizer) Return a newClientHttpConnectorBuilderthat applies the given customizer to theClientHttpConnectorafter it has been built.default ClientHttpConnectorBuilder<T>withCustomizers(Collection<Consumer<T>> customizers) Return a newClientHttpConnectorBuilderthat applies the given customizers to theClientHttpConnectorafter it has been built.
-
Method Details
-
build
Build a default configuredClientHttpConnectorBuilder.- Returns:
- a default configured
ClientHttpConnectorBuilder.
-
build
Build a fully configuredClientHttpConnector, applying the givensettingsif they are provided.- Parameters:
settings- the settings to apply ornull- Returns:
- a fully configured
ClientHttpConnector.
-
withCustomizer
Return a newClientHttpConnectorBuilderthat applies the given customizer to theClientHttpConnectorafter it has been built.- Parameters:
customizer- the customizers to apply- Returns:
- a new
ClientHttpConnectorBuilderinstance
-
withCustomizers
Return a newClientHttpConnectorBuilderthat applies the given customizers to theClientHttpConnectorafter it has been built.- Parameters:
customizers- the customizers to apply- Returns:
- a new
ClientHttpConnectorBuilderinstance
-
httpComponents
Return aHttpComponentsClientHttpConnectorBuilderthat can be used to build aHttpComponentsClientHttpConnector.- Returns:
- a new
HttpComponentsClientHttpConnectorBuilder
-
jetty
Return aJettyClientHttpConnectorBuilderthat can be used to build aJettyClientHttpConnector.- Returns:
- a new
JettyClientHttpConnectorBuilder
-
reactor
Return aReactorClientHttpConnectorBuilderthat can be used to build aReactorClientHttpConnector.- Returns:
- a new
ReactorClientHttpConnectorBuilder
-
jdk
Return aJdkClientHttpConnectorBuilderthat can be used to build aJdkClientHttpConnector.- Returns:
- a new
JdkClientHttpConnectorBuilder
-
of
static <T extends org.springframework.http.client.reactive.ClientHttpConnector> ClientHttpConnectorBuilder<T> of(Class<T> clientHttpConnectorType) Return a newClientHttpConnectorBuilderfor the givenrequestFactoryType. The following implementations are supported:ReactorClientHttpConnectorJettyClientHttpConnectorHttpComponentsClientHttpConnectorJdkClientHttpConnector
- Type Parameters:
T- theClientHttpConnectortype- Parameters:
clientHttpConnectorType- theClientHttpConnectortype- Returns:
- a new
ClientHttpConnectorBuilder
-
detect
static ClientHttpConnectorBuilder<? extends org.springframework.http.client.reactive.ClientHttpConnector> detect()Detect the most suitableClientHttpConnectorBuilderbased on the classpath. The method favors builders in the following order:- Returns:
- the most suitable
ClientHttpConnectorBuilderfor the classpath
-
detect
static ClientHttpConnectorBuilder<? extends org.springframework.http.client.reactive.ClientHttpConnector> detect(ClassLoader classLoader) Detect the most suitableClientHttpConnectorBuilderbased on the classpath. The method favors builders in the following order:- Parameters:
classLoader- the class loader to use for detection- Returns:
- the most suitable
ClientHttpConnectorBuilderfor the classpath
-