Package org.forgerock.openig.reactive
Class MdcAwareSingleObserver<T>
- java.lang.Object
-
- org.forgerock.openig.reactive.MdcAwareSingleObserver<T>
-
- Type Parameters:
T
- the SingleObserver's type.
- All Implemented Interfaces:
io.reactivex.rxjava3.core.SingleObserver<T>
public final class MdcAwareSingleObserver<T> extends Object implements io.reactivex.rxjava3.core.SingleObserver<T>
A SingleObserver wrapper that manages the MDC.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> io.reactivex.rxjava3.core.SingleObserver<T>
mdcAwareSingleObserver(io.reactivex.rxjava3.core.SingleObserver<T> delegate)
Wraps the delegate SingleObserver with another SingleObserver instance that will capture the current MDC context, and will use it when delegating the calls to the delegated SingleObserver.void
onError(@NonNull Throwable t)
void
onSubscribe(@NonNull io.reactivex.rxjava3.disposables.Disposable disposable)
void
onSuccess(T value)
-
-
-
Method Detail
-
onSubscribe
public void onSubscribe(@NonNull @NonNull io.reactivex.rxjava3.disposables.Disposable disposable)
- Specified by:
onSubscribe
in interfaceio.reactivex.rxjava3.core.SingleObserver<T>
-
onError
public void onError(@NonNull @NonNull Throwable t)
- Specified by:
onError
in interfaceio.reactivex.rxjava3.core.SingleObserver<T>
-
onSuccess
public void onSuccess(@NonNull T value)
- Specified by:
onSuccess
in interfaceio.reactivex.rxjava3.core.SingleObserver<T>
-
mdcAwareSingleObserver
public static <T> io.reactivex.rxjava3.core.SingleObserver<T> mdcAwareSingleObserver(io.reactivex.rxjava3.core.SingleObserver<T> delegate)
Wraps the delegate SingleObserver with another SingleObserver instance that will capture the current MDC context, and will use it when delegating the calls to the delegated SingleObserver.- Type Parameters:
T
- The wrapped SingleObserver's return type.- Parameters:
delegate
- The wrapped observer- Returns:
- a wrapped SingleObserver.
-
-