パッケージ org.springframework.core
クラス ReactiveAdapterRegistry
java.lang.ObjectSE
org.springframework.core.ReactiveAdapterRegistry
Reactive Streams
Publisher
を、CompletableFuture
、RxJava Flowable
などのさまざまな非同期 / リアクティブ型との間で適合させるためのアダプターのレジストリ。 デフォルトでは、クラスパスの可用性に応じて、アダプターは Reactor、RxJava 3、CompletableFuture
SE、Flow.Publisher
、Kotlin コルーチンの Deferred
と Flow
に登録されます。
- 導入:
- 5.0
- 作成者:
- Rossen Stoyanchev, Sebastien Deleuze, Juergen Hoeller
ネストされたクラスのサマリー
修飾子と型クラス説明static class
spring-core クラスのBlockHoundIntegration
。コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明getAdapter
(ClassSE<?> reactiveType) 指定されたリアクティブ型のアダプターを取得します。getAdapter
(ClassSE<?> reactiveType, ObjectSE source) 指定されたリアクティブ型のアダプターを取得します。static ReactiveAdapterRegistry
共有のデフォルトReactiveAdapterRegistry
インスタンスを返し、必要に応じて遅延ビルドします。boolean
レジストリにアダプターがあるかどうか。void
registerReactiveType
(ReactiveTypeDescriptor descriptor, FunctionSE<ObjectSE, Publisher<?>> toAdapter, FunctionSE<Publisher<?>, ObjectSE> fromAdapter)
コンストラクターの詳細
ReactiveAdapterRegistry
public ReactiveAdapterRegistry()レジストリを作成し、デフォルトのアダプターを自動登録します。- 関連事項:
メソッドの詳細
hasAdapters
public boolean hasAdapters()レジストリにアダプターがあるかどうか。registerReactiveType
public void registerReactiveType(ReactiveTypeDescriptor descriptor, FunctionSE<ObjectSE, Publisher<?>> toAdapter, FunctionSE<Publisher<?>, ObjectSE> fromAdapter) Reactive StreamsPublisher
に適合したり、Reactive StreamsPublisher
から適合したりする関数とともにリアクティブ型を登録します。関数の引数は、入力がnull
でもOptional
SE でもないことを前提としています。getAdapter
指定されたリアクティブ型のアダプターを取得します。- 戻り値:
- 対応するアダプター、または使用可能なものがなければ
null
getAdapter
@Nullable public ReactiveAdapter getAdapter(@Nullable ClassSE<?> reactiveType, @Nullable ObjectSE source) 指定されたリアクティブ型のアダプターを取得します。または、「ソース」オブジェクトが指定されている場合は、実際の型が代わりに使用されます。- パラメーター:
reactiveType
- リアクティブ型 (具体的なソースオブジェクトが指定されている場合、null
になる可能性があります)source
- リアクティブ型のインスタンス (つまり、適応する ; リアクティブ型が指定されている場合、null
になる場合があります)- 戻り値:
- 対応するアダプター、または使用可能なものがなければ
null