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 of Action that will preserve the SLF4J MDC.
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.reactivex.rxjava3.functions.Action
    mdcAwareAction(io.reactivex.rxjava3.functions.Action delegate)
    Wraps the delegate Action with another Action instance that will capture the current MDC context, and will use it when delegating the calls to the delegated Action.
    static io.reactivex.rxjava3.functions.Action
    mdcAwareAction(Map<String,String> mdc, io.reactivex.rxjava3.functions.Action delegate)
    Wraps the delegate Action with another Action instance that will use the provided MDC context when delegating the calls to the delegated Action.
    void
    run()
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • run

      public void run() throws Throwable
      Specified by:
      run in interface io.reactivex.rxjava3.functions.Action
      Throws:
      Throwable
    • mdcAwareAction

      public static io.reactivex.rxjava3.functions.Action mdcAwareAction(io.reactivex.rxjava3.functions.Action delegate)
      Wraps the delegate Action with another Action instance that will capture the current MDC context, and will use it when delegating the calls to the delegated Action.
      Parameters:
      delegate - the Subscriber to delegate the calls to
      Returns:
      A Action that will position the captured MDC 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 delegate Action with another Action instance that will use the provided MDC context when delegating the calls to the delegated Action.
      Parameters:
      mdc - The MDC to use when delegating the calls
      delegate - the Action to delegate the calls to
      Returns:
      A Action that will position the captured MDC context before each call.