Class RSocketServiceProxyFactory
java.lang.Object
org.springframework.messaging.rsocket.service.RSocketServiceProxyFactory
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.EmbeddedValueResolverAware
public final class RSocketServiceProxyFactory
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.EmbeddedValueResolverAware
Factory for creating a client proxy given an RSocket service interface with
@RSocketExchange methods.
This class is intended to be declared as a bean in Spring configuration.
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder to create anRSocketServiceProxyFactory. -
Constructor Summary
ConstructorsConstructorDescriptionRSocketServiceProxyFactory(RSocketRequester rsocketRequester) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the RSocketServiceProxyFactory 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 RSocketServiceProxyFactory instance.voidDeprecated.builder()Return anRSocketServiceProxyFactorybuilder.builder(RSocketRequester requester) Return anRSocketServiceProxyFactorybuilder, initialized with the given client.<S> ScreateClient(Class<S> serviceType) Return a proxy that implements the given RSocket service interface to perform RSocket requests and retrieve responses through the configuredRSocketRequester.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 RSocketServiceProxyFactory instance.voidDeprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the RSocketServiceProxyFactory 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 RSocketServiceProxyFactory 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 RSocketServiceProxyFactory instance.
-
Constructor Details
-
RSocketServiceProxyFactory
@Deprecated(since="6.0.0-RC2", forRemoval=true) public RSocketServiceProxyFactory(RSocketRequester rsocketRequester) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the RSocketServiceProxyFactory instance.Create an instance with the underlying RSocketRequester to perform requests with.- Parameters:
rsocketRequester- the requester to use
-
-
Method Details
-
addCustomArgumentResolver
@Deprecated(since="6.0.0-RC2", forRemoval=true) public void addCustomArgumentResolver(RSocketServiceArgumentResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the RSocketServiceProxyFactory 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<RSocketServiceArgumentResolver> resolvers) Deprecated, for removal: This API element is subject to removal in a future version.in favor of using the Builder to initialize the RSocketServiceProxyFactory instance.Set the custom argument resolvers to use, ahead of default resolvers.- Parameters:
resolvers- the resolvers to use
-
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 RSocketServiceProxyFactory instance.Set the StringValueResolver to use for resolving placeholders and expressions inRSocketExchange.value().- 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 RSocketServiceProxyFactory instance.Set theReactiveAdapterRegistryto use to support different asynchronous types for RSocket 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 RSocketServiceProxyFactory instance.Configure how long to wait for a response for an RSocket 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 RSocket service interface to perform RSocket requests and retrieve responses through the configuredRSocketRequester.- Type Parameters:
S- the RSocket service type- Parameters:
serviceType- the RSocket service to create a proxy for- Returns:
- the created proxy
-
builder
Return anRSocketServiceProxyFactorybuilder, initialized with the given client. -
builder
Return anRSocketServiceProxyFactorybuilder.
-