Class HttpServiceProxyFactory
java.lang.Object
org.springframework.web.service.invoker.HttpServiceProxyFactory
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.EmbeddedValueResolverAware
public final class HttpServiceProxyFactory
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.EmbeddedValueResolverAware
Factory to create a client proxy from an HTTP service interface with
@HttpExchange methods.
To create an instance, use static methods to obtain a Builder.
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
- See Also:
-
org.springframework.web.reactive.function.client.support.WebClientAdapter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder to create anHttpServiceProxyFactory. -
Constructor Summary
ConstructorsConstructorDescriptionHttpServiceProxyFactory(HttpClientAdapter clientAdapter) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.voidDeprecated.builder()Return anHttpServiceProxyFactorybuilder.builder(HttpClientAdapter clientAdapter) Return anHttpServiceProxyFactorybuilder, initialized with the given client.<S> ScreateClient(Class<S> serviceType) Return a proxy that implements the given HTTP service interface to perform HTTP requests and retrieve responses through an HTTP client.voidsetBlockTimeout(Duration blockTimeout) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.voidsetConversionService(org.springframework.core.convert.ConversionService conversionService) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.voidDeprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.voidsetEmbeddedValueResolver(org.springframework.util.StringValueResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.voidsetReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry registry) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.
-
Constructor Details
-
HttpServiceProxyFactory
@Deprecated(since="6.0.0-RC2", forRemoval=true) public HttpServiceProxyFactory(HttpClientAdapter clientAdapter) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Create an instance with the underlying HTTP client to use.- Parameters:
clientAdapter- an adapter for the client
-
-
Method Details
-
addCustomArgumentResolver
@Deprecated(since="6.0.0-RC2", forRemoval=true) public void addCustomArgumentResolver(HttpServiceArgumentResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Register a custom argument resolver, invoked ahead of default resolvers.- Parameters:
resolver- the resolver to add
-
setCustomArgumentResolvers
@Deprecated(since="6.0.0-RC2", forRemoval=true) public void setCustomArgumentResolvers(List<HttpServiceArgumentResolver> resolvers) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Set the custom argument resolvers to use, ahead of default resolvers.- Parameters:
resolvers- the resolvers to use
-
setConversionService
@Deprecated(since="6.0.0-RC2", forRemoval=true) public void setConversionService(org.springframework.core.convert.ConversionService conversionService) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Set theConversionServiceto use where input values need to be formatted as Strings.By default this is
DefaultFormattingConversionService. -
setEmbeddedValueResolver
@Deprecated(since="6.0.0-RC2", forRemoval=true) public void setEmbeddedValueResolver(org.springframework.util.StringValueResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Set the StringValueResolver to use for resolving placeholders and expressions inHttpExchange.url().- Specified by:
setEmbeddedValueResolverin interfaceorg.springframework.context.EmbeddedValueResolverAware- Parameters:
resolver- the resolver to use
-
setReactiveAdapterRegistry
@Deprecated(since="6.0.0-RC2", forRemoval=true) public void setReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry registry) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Set theReactiveAdapterRegistryto use to support different asynchronous types for HTTP service method return values.By default this is
ReactiveAdapterRegistry.getSharedInstance(). -
setBlockTimeout
Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the HttpServiceProxyFactory instance.Configure how long to wait for a response for an HTTP service method with a synchronous (blocking) method signature.By default this is 5 seconds.
- Parameters:
blockTimeout- the timeout value
-
afterPropertiesSet
Deprecated.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
createClient
Return a proxy that implements the given HTTP service interface to perform HTTP requests and retrieve responses through an HTTP client.- Type Parameters:
S- the HTTP service type- Parameters:
serviceType- the HTTP service to create a proxy for- Returns:
- the created proxy
-
builder
Return anHttpServiceProxyFactorybuilder, initialized with the given client. -
builder
Return anHttpServiceProxyFactorybuilder.
-