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.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 Details
-
run
- 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
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.
-