public class ReactiveAdapterRegistry extends ObjectSE
Publisher
を、CompletableFuture
、RxJava Flowable
などのさまざまな非同期 / リアクティブ型との間で適合させるためのアダプターのレジストリ。 デフォルトでは、クラスパスの可用性に応じて、アダプターは Reactor、RxJava 3、CompletableFuture
SE、Flow.Publisher
、Kotlin コルーチンの Deferred
と Flow
に登録されます。
注意 : Spring Framework 5.3.11 の時点で、RxJava 1.x および 2.x のサポートは廃止され、RxJava 3 が優先されます。
修飾子と型 | クラスと説明 |
---|---|
static class | ReactiveAdapterRegistry.SpringCoreBlockHoundIntegration spring-core クラスの BlockHoundIntegration 。 |
コンストラクターと説明 |
---|
ReactiveAdapterRegistry() レジストリを作成し、デフォルトのアダプターを自動登録します。 |
修飾子と型 | メソッドと説明 |
---|---|
ReactiveAdapter | getAdapter(ClassSE<?> reactiveType) 指定されたリアクティブ型のアダプターを取得します。 |
ReactiveAdapter | getAdapter(ClassSE<?> reactiveType, ObjectSE source) 指定されたリアクティブ型のアダプターを取得します。 |
static ReactiveAdapterRegistry | getSharedInstance() 共有のデフォルト ReactiveAdapterRegistry インスタンスを返し、必要に応じて遅延ビルドします。 |
boolean | hasAdapters() レジストリにアダプターがあるかどうか。 |
void | registerReactiveType(ReactiveTypeDescriptor descriptor, FunctionSE<ObjectSE, Publisher<?>> toAdapter, FunctionSE<Publisher<?>,ObjectSE> fromAdapter) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public ReactiveAdapterRegistry()
getSharedInstance()
public boolean hasAdapters()
public void registerReactiveType(ReactiveTypeDescriptor descriptor, FunctionSE<ObjectSE,Publisher<?>> toAdapter, FunctionSE<Publisher<?>,ObjectSE> fromAdapter)
Publisher
に適合したり、Reactive Streams Publisher
から適合したりする関数とともにリアクティブ型を登録します。関数の引数は、入力が null
でも Optional
SE でもないことを前提としています。@Nullable public ReactiveAdapter getAdapter(ClassSE<?> reactiveType)
null
@Nullable public ReactiveAdapter getAdapter(@Nullable ClassSE<?> reactiveType, @Nullable ObjectSE source)
reactiveType
- リアクティブ型 (具体的なソースオブジェクトが指定されている場合、null
になる可能性があります)source
- リアクティブ型のインスタンス (つまり、適応する ; リアクティブ型が指定されている場合、null
になる場合があります)null
public static ReactiveAdapterRegistry getSharedInstance()
ReactiveAdapterRegistry
インスタンスを返し、必要に応じて遅延ビルドします。 注意 : カスタマイズを目的として、長期間有効な事前構成済みの ReactiveAdapterRegistry
インスタンスを渡すことを強くお勧めします。このアクセサーは、提供されていない場合にデフォルトのインスタンスにフォールバックしたいコードパスのフォールバックとしてのみ意図されています。
ReactiveAdapterRegistry
インスタンス