Package org.springframework.core
Class ReactiveAdapterRegistry
java.lang.Object
org.springframework.core.ReactiveAdapterRegistry
A registry of adapters to adapt Reactive Streams 
Publisher to/from
 various async/reactive types such as CompletableFuture, RxJava
 Flowable, and others.
 By default, depending on classpath availability, adapters are registered
 for Reactor, RxJava 3, CompletableFuture, Flow.Publisher,
 and Kotlin Coroutines' Deferred and Flow.
- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Sebastien Deleuze, Juergen Hoeller
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBlockHoundIntegrationfor spring-core classes.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a registry and auto-register default adapters.
- 
Method SummaryModifier and TypeMethodDescriptiongetAdapter(Class<?> reactiveType) Get the adapter for the given reactive type.getAdapter(Class<?> reactiveType, Object source) Get the adapter for the given reactive type.static ReactiveAdapterRegistryReturn a shared defaultReactiveAdapterRegistryinstance, lazily building it once needed.booleanWhether the registry has any adapters.voidregisterReactiveType(ReactiveTypeDescriptor descriptor, Function<Object, Publisher<?>> toAdapter, Function<Publisher<?>, Object> fromAdapter) Register a reactive type along with functions to adapt to and from a Reactive StreamsPublisher.
- 
Constructor Details- 
ReactiveAdapterRegistrypublic ReactiveAdapterRegistry()Create a registry and auto-register default adapters.- See Also:
 
 
- 
- 
Method Details- 
hasAdapterspublic boolean hasAdapters()Whether the registry has any adapters.
- 
registerReactiveType
- 
getAdapterGet the adapter for the given reactive type.- Returns:
- the corresponding adapter, or nullif none available
 
- 
getAdapter@Nullable public ReactiveAdapter getAdapter(@Nullable Class<?> reactiveType, @Nullable Object source) Get the adapter for the given reactive type. Or if a "source" object is provided, its actual type is used instead.- Parameters:
- reactiveType- the reactive type (may be- nullif a concrete source object is given)
- source- an instance of the reactive type (i.e. to adapt from; may be- nullif the reactive type is specified)
- Returns:
- the corresponding adapter, or nullif none available
 
 
-