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 ofAction
that will preserve the SLF4JMDC
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static io.reactivex.rxjava3.functions.Action
mdcAwareAction(io.reactivex.rxjava3.functions.Action delegate)
Wraps the delegateAction
with anotherAction
instance that will capture the currentMDC
context, and will use it when delegating the calls to the delegatedAction
.static io.reactivex.rxjava3.functions.Action
mdcAwareAction(Map<String,String> mdc, io.reactivex.rxjava3.functions.Action delegate)
Wraps the delegateAction
with anotherAction
instance that will use the providedMDC
context when delegating the calls to the delegatedAction
.void
run()
-
-
-
Method Detail
-
run
public void run() throws Throwable
- Specified by:
run
in interfaceio.reactivex.rxjava3.functions.Action
- Throws:
Throwable
-
mdcAwareAction
public static io.reactivex.rxjava3.functions.Action mdcAwareAction(io.reactivex.rxjava3.functions.Action delegate)
Wraps the delegateAction
with anotherAction
instance that will capture the currentMDC
context, and will use it when delegating the calls to the delegatedAction
.- Parameters:
delegate
- the Subscriber to delegate the calls to- Returns:
- A
Action
that will position the capturedMDC
context 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 delegateAction
with anotherAction
instance that will use the providedMDC
context when delegating the calls to the delegatedAction
.- Parameters:
mdc
- TheMDC
to use when delegating the callsdelegate
- the Action to delegate the calls to- Returns:
- A
Action
that will position the capturedMDC
context before each call.
-
-