Class AbortableTaskRunnable

  • All Implemented Interfaces:
    Runnable

    public class AbortableTaskRunnable
    extends Object
    implements Runnable
    Delegating Runnable that copies the MDC to the executing thread before running the delegate.
    Since:
    2.0.0
    Author:
    Rutger Lubbers, Paul Klos
    • Constructor Detail

      • AbortableTaskRunnable

        public AbortableTaskRunnable​(@NotNull
                                     @NotNull MdcContext mdcContext,
                                     @NotNull
                                     @NotNull Runnable delegate,
                                     @NotNull
                                     @NotNull SharedTaskContext sharedTaskContext)
        Construct a new instance.
        Parameters:
        mdcContext - the MDC context (of the calling thread).
        delegate - the delegate to run.
        sharedTaskContext - the abort strategy to set.
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable