Package org.forgerock.http.protocol
Class MdcAwareAction
java.lang.Object
org.forgerock.http.protocol.MdcAwareAction
- All Implemented Interfaces:
io.reactivex.rxjava3.functions.Action
An implementation of
Action that will preserve the SLF4J MDC.-
Method Summary
Modifier and TypeMethodDescriptionstatic io.reactivex.rxjava3.functions.ActionmdcAwareAction(io.reactivex.rxjava3.functions.Action delegate) Wraps the delegateActionwith anotherActioninstance that will capture the currentMDCcontext, and will use it when delegating the calls to the delegatedAction.static io.reactivex.rxjava3.functions.ActionmdcAwareAction(Map<String, String> mdc, io.reactivex.rxjava3.functions.Action delegate) Wraps the delegateActionwith anotherActioninstance that will use the providedMDCcontext when delegating the calls to the delegatedAction.voidrun()
-
Method Details
-
run
- Specified by:
runin interfaceio.reactivex.rxjava3.functions.Action- Throws:
Throwable
-
mdcAwareAction
public static io.reactivex.rxjava3.functions.Action mdcAwareAction(io.reactivex.rxjava3.functions.Action delegate) Wraps the delegateActionwith anotherActioninstance that will capture the currentMDCcontext, and will use it when delegating the calls to the delegatedAction.- Parameters:
delegate- the Subscriber to delegate the calls to- Returns:
- A
Actionthat will position the capturedMDCcontext before each call. - See Also:
-
mdcAwareAction
public static io.reactivex.rxjava3.functions.Action mdcAwareAction(Map<String, String> mdc, io.reactivex.rxjava3.functions.Action delegate) Wraps the delegateActionwith anotherActioninstance that will use the providedMDCcontext when delegating the calls to the delegatedAction.- Parameters:
mdc- TheMDCto use when delegating the callsdelegate- the Action to delegate the calls to- Returns:
- A
Actionthat will position the capturedMDCcontext before each call.
-