Top Description Inners Fields Constructors Methods
org.springframework.messaging.rsocket

pack-priv final Class DefaultRSocketStrategies

extends Object
implements RSocketStrategies
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.rsocket.RSocketStrategies
Imports
java.util.ArrayList, .Arrays, .Collections, .List, java.util.function.Consumer, io.netty.buffer.PooledByteBufAllocator, org.springframework.core.ReactiveAdapterRegistry, org.springframework.core.codec.ByteArrayDecoder, .ByteArrayEncoder, .ByteBufferDecoder, .ByteBufferEncoder, .CharSequenceEncoder, .DataBufferDecoder, .DataBufferEncoder, .Decoder, .Encoder, .StringDecoder, org.springframework.core.io.buffer.DataBufferFactory, .NettyDataBufferFactory, org.springframework.lang.Nullable, org.springframework.util.AntPathMatcher, .RouteMatcher, .SimpleRouteMatcher

Default implementation of RSocketStrategies.
Authors
Rossen Stoyanchev, Brian Clozel
Since
5.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final ReactiveAdapterRegistry
private final DataBufferFactory
private final List<Decoder<?>>
private final List<Encoder<?>>
private final MetadataExtractor
private final RouteMatcher

Constructor Summary

AccessConstructor and Description
private
DefaultRSocketStrategies(List<Encoder<?>> encoders, List<Decoder<?>> decoders, RouteMatcher routeMatcher, ReactiveAdapterRegistry adapterRegistry, DataBufferFactory bufferFactory, MetadataExtractor metadataExtractor)

Method Summary

Modifier and TypeMethod and Description
public DataBufferFactory
public List<Decoder<?>>
public List<Encoder<?>>
public MetadataExtractor
public ReactiveAdapterRegistry
public RouteMatcher
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adapterRegistryback to summary
private final ReactiveAdapterRegistry adapterRegistry
bufferFactoryback to summary
private final DataBufferFactory bufferFactory
decodersback to summary
private final List<Decoder<?>> decoders
encodersback to summary
private final List<Encoder<?>> encoders
metadataExtractorback to summary
private final MetadataExtractor metadataExtractor
routeMatcherback to summary
private final RouteMatcher routeMatcher

Constructor Detail

DefaultRSocketStrategiesback to summary
private DefaultRSocketStrategies(List<Encoder<?>> encoders, List<Decoder<?>> decoders, RouteMatcher routeMatcher, ReactiveAdapterRegistry adapterRegistry, DataBufferFactory bufferFactory, MetadataExtractor metadataExtractor)

Method Detail

dataBufferFactoryback to summary
public DataBufferFactory dataBufferFactory()

Implements org.springframework.messaging.rsocket.RSocketStrategies.dataBufferFactory.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.dataBufferFactory.

Return the configured dataBufferFactory.

Annotations
@Override
decodersback to summary
public List<Decoder<?>> decoders()

Implements org.springframework.messaging.rsocket.RSocketStrategies.decoders.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.decoders.

Return the configured decoders.

Annotations
@Override
encodersback to summary
public List<Encoder<?>> encoders()

Implements org.springframework.messaging.rsocket.RSocketStrategies.encoders.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.encoders.

Return the configured encoders.

Annotations
@Override
metadataExtractorback to summary
public MetadataExtractor metadataExtractor()

Implements org.springframework.messaging.rsocket.RSocketStrategies.metadataExtractor.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.metadataExtractor.

Return the configured Builder#metadataExtractor(MetadataExtractor).

Annotations
@Override
reactiveAdapterRegistryback to summary
public ReactiveAdapterRegistry reactiveAdapterRegistry()

Implements org.springframework.messaging.rsocket.RSocketStrategies.reactiveAdapterRegistry.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.reactiveAdapterRegistry.

Return the configured reactiveAdapterRegistry.

Annotations
@Override
routeMatcherback to summary
public RouteMatcher routeMatcher()

Implements org.springframework.messaging.rsocket.RSocketStrategies.routeMatcher.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.routeMatcher.

Return the configured Builder#routeMatcher(RouteMatcher).

Annotations
@Override
org.springframework.messaging.rsocket back to summary

pack-priv Class DefaultRSocketStrategies.DefaultRSocketStrategiesBuilder

extends Object
implements Builder
Class Inheritance
  • java.lang.Object
  • org.springframework.messaging.rsocket.DefaultRSocketStrategies.DefaultRSocketStrategiesBuilder
All Implemented Interfaces
org.springframework.messaging.rsocket.RSocketStrategies.Builder

Default implementation of RSocketStrategies.Builder.

Field Summary

Modifier and TypeField and Description
private ReactiveAdapterRegistry
private DataBufferFactory
private final List<Decoder<?>>
private final List<Encoder<?>>
private MetadataExtractor
private final List<Consumer<MetadataExtractorRegistry>>
private RouteMatcher

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public RSocketStrategies
build()

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.build.

Build the RSocketStrategies instance.
public RSocketStrategies.Builder
dataBufferFactory(DataBufferFactory bufferFactory)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.dataBufferFactory.

Configure the DataBufferFactory to use for allocating buffers when preparing requests or creating responses.
public RSocketStrategies.Builder
decoder(Decoder<?>... decoder)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.decoder.

Append to the list of decoders to use for de-serializing Objects from the data or metadata of a Payload.
public RSocketStrategies.Builder
decoders(Consumer<List<Decoder<?>>> consumer)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.decoders.

Apply the consumer to the list of configured decoders, immediately.
public RSocketStrategies.Builder
encoder(Encoder<?>... encoders)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.encoder.

Append to the list of encoders to use for serializing Objects to the data or metadata of a Payload.
public RSocketStrategies.Builder
encoders(Consumer<List<Encoder<?>>> consumer)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.encoders.

Apply the consumer to the list of configured encoders, immediately.
private RouteMatcher
public RSocketStrategies.Builder
metadataExtractor(MetadataExtractor metadataExtractor)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.metadataExtractor.

Configure a MetadataExtractor to extract the route along with other metadata.
public RSocketStrategies.Builder
public RSocketStrategies.Builder
public RSocketStrategies.Builder
routeMatcher(RouteMatcher routeMatcher)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.routeMatcher.

Configure a RouteMatcher for matching routes to message handlers based on route patterns.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adapterRegistryback to summary
private ReactiveAdapterRegistry adapterRegistry
Annotations
@Nullable
bufferFactoryback to summary
private DataBufferFactory bufferFactory
Annotations
@Nullable
decodersback to summary
private final List<Decoder<?>> decoders
encodersback to summary
private final List<Encoder<?>> encoders
metadataExtractorback to summary
private MetadataExtractor metadataExtractor
Annotations
@Nullable
metadataExtractorsback to summary
private final List<Consumer<MetadataExtractorRegistry>> metadataExtractors
routeMatcherback to summary
private RouteMatcher routeMatcher
Annotations
@Nullable

Constructor Detail

DefaultRSocketStrategiesBuilderback to summary
pack-priv DefaultRSocketStrategiesBuilder()
DefaultRSocketStrategiesBuilderback to summary
pack-priv DefaultRSocketStrategiesBuilder(RSocketStrategies other)

Method Detail

buildback to summary
public RSocketStrategies build()

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.build.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.build.

Build the RSocketStrategies instance.

Annotations
@Override
dataBufferFactoryback to summary
public RSocketStrategies.Builder dataBufferFactory(DataBufferFactory bufferFactory)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.dataBufferFactory.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.dataBufferFactory.

Configure the DataBufferFactory to use for allocating buffers when preparing requests or creating responses.

By default this is set to NettyDataBufferFactory with pooled, allocated buffers for zero copy. RSocket must also be configured for zero copy. For client setup, RSocketRequester.Builder adapts automatically to the DataBufferFactory configured here, and sets the frame decoder in RSocketConnector accordingly. For server setup, the RSocketServer must be configured accordingly for zero copy too.

If using DefaultDataBufferFactory instead, there is no need for related config changes in RSocket.

Annotations
@Override
decoderback to summary
public RSocketStrategies.Builder decoder(Decoder<?>... decoder)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.decoder.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.decoder.

Append to the list of decoders to use for de-serializing Objects from the data or metadata of a Payload.

By default this is initialized with decoders for String, byte[], ByteBuffer, and DataBuffer.

Annotations
@Override
decodersback to summary
public RSocketStrategies.Builder decoders(Consumer<List<Decoder<?>>> consumer)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.decoders.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.decoders.

Apply the consumer to the list of configured decoders, immediately.

Annotations
@Override
encoderback to summary
public RSocketStrategies.Builder encoder(Encoder<?>... encoders)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.encoder.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.encoder.

Append to the list of encoders to use for serializing Objects to the data or metadata of a Payload.

By default this is initialized with encoders for String, byte[], ByteBuffer, and DataBuffer.

Annotations
@Override
encodersback to summary
public RSocketStrategies.Builder encoders(Consumer<List<Encoder<?>>> consumer)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.encoders.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.encoders.

Apply the consumer to the list of configured encoders, immediately.

Annotations
@Override
initRouteMatcherback to summary
private RouteMatcher initRouteMatcher()
metadataExtractorback to summary
public RSocketStrategies.Builder metadataExtractor(MetadataExtractor metadataExtractor)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.metadataExtractor.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.metadataExtractor.

Configure a MetadataExtractor to extract the route along with other metadata. This option is applicable to client or server responders.

By default this is DefaultMetadataExtractor created with the configured decoders and extracting a route from "message/x.rsocket.routing.v0" metadata.

Annotations
@Override
metadataExtractorRegistryback to summary
public RSocketStrategies.Builder metadataExtractorRegistry(Consumer<MetadataExtractorRegistry> consumer)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.metadataExtractorRegistry.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.metadataExtractorRegistry.

Apply the consumer to the MetadataExtractorRegistry in order to register extra metadata entry extractors.

Annotations
@Override
reactiveAdapterStrategyback to summary
public RSocketStrategies.Builder reactiveAdapterStrategy(ReactiveAdapterRegistry registry)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.reactiveAdapterStrategy.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.reactiveAdapterStrategy.

Configure the registry for reactive type support. This can be used to adapt to, and/or determine the semantics of a given Publisher.

By default this ReactiveAdapterRegistry#getSharedInstance().

Annotations
@Override
routeMatcherback to summary
public RSocketStrategies.Builder routeMatcher(RouteMatcher routeMatcher)

Implements org.springframework.messaging.rsocket.RSocketStrategies.Builder.routeMatcher.

Doc from org.springframework.messaging.rsocket.RSocketStrategies.Builder.routeMatcher.

Configure a RouteMatcher for matching routes to message handlers based on route patterns. This option is applicable to client or server responders.

By default, SimpleRouteMatcher is used, backed by AntPathMatcher with "." as separator. For better efficiency consider switching to PathPatternRouteMatcher from spring-web instead.

Annotations
@Override