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.voidonError(@NonNull Throwable t)voidonSubscribe(@NonNull io.reactivex.rxjava3.disposables.Disposable disposable)voidonSuccess(T value)
-
-
-
Method Detail
-
onSubscribe
public void onSubscribe(@NonNull @NonNull io.reactivex.rxjava3.disposables.Disposable disposable)- Specified by:
onSubscribein interfaceio.reactivex.rxjava3.core.SingleObserver<T>
-
onError
public void onError(@NonNull @NonNull Throwable t)- Specified by:
onErrorin interfaceio.reactivex.rxjava3.core.SingleObserver<T>
-
onSuccess
public void onSuccess(@NonNull T value)- Specified by:
onSuccessin 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.
-
-