Package org.forgerock.http.protocol
Class MdcAwareAction
- java.lang.Object
-
- org.forgerock.http.protocol.MdcAwareAction
-
- All Implemented Interfaces:
io.reactivex.rxjava3.functions.Action
public final class MdcAwareAction extends Object implements io.reactivex.rxjava3.functions.Action
An implementation ofActionthat will preserve the SLF4JMDC.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
run
public void run() throws Throwable- 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(Action)
-
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.
-
-