/** * @return A {@link Function} that wraps the given original so that the given {@link ChannelHandlerContext}'s * distributed tracing and MDC information is registered with the thread and therefore available during execution * and unregistered after execution. */ public static <T, U> Function<T, U> functionWithTracingAndMdc(Function<T, U> fn, ChannelHandlerContext ctx) { return new FunctionWithTracingAndMdcSupport<>(fn, ctx); }
/** * @return A {@link Callable} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <U> Callable<U> callableWithTracingAndMdc(Callable<U> callable, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new CallableWithTracingAndMdcSupport<>(callable, threadInfoToLink); }
/** * @return A {@link Supplier} that wraps the given original so that the given {@link ChannelHandlerContext}'s * distributed tracing and MDC information is registered with the thread and therefore available during execution * and unregistered after execution. */ public static <U> Supplier<U> supplierWithTracingAndMdc(Supplier<U> supplier, ChannelHandlerContext ctx) { return new SupplierWithTracingAndMdcSupport<>(supplier, ctx); }
/** * @return A {@link Runnable} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static Runnable runnableWithTracingAndMdc(Runnable runnable, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new RunnableWithTracingAndMdcSupport(runnable, threadInfoToLink); }
/** * @return A {@link BiFunction} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <T, U, R> BiFunction<T, U, R> biFunctionWithTracingAndMdc( BiFunction<T, U, R> fn, Pair<Deque<Span>, Map<String, String>> threadInfoToLink ) { return new BiFunctionWithTracingAndMdcSupport<>(fn, threadInfoToLink); }
/** * @return A {@link Consumer} that wraps the given original so that the given {@link ChannelHandlerContext}'s * distributed tracing and MDC information is registered with the thread and therefore available during execution * and unregistered after execution. */ public static <T> Consumer<T> consumerWithTracingAndMdc(Consumer<T> consumer, ChannelHandlerContext ctx) { return new ConsumerWithTracingAndMdcSupport<>(consumer, ctx); }
/** * @return A {@link BiConsumer} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <T, U> BiConsumer<T, U> biConsumerWithTracingAndMdc(BiConsumer<T, U> biConsumer, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new BiConsumerWithTracingAndMdcSupport<>(biConsumer, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Callable} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <U> Callable<U> callableWithTracingAndMdc(Callable<U> callable, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new CallableWithTracingAndMdcSupport<>(callable, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Supplier} that wraps the given distributed tracing and MDC information is registered with the * thread and therefore available during execution and unregistered after execution. */ public static <U> Supplier<U> supplierWithTracingAndMdc(Supplier<U> supplier, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new SupplierWithTracingAndMdcSupport<>(supplier, threadInfoToLink); }
/** * @return A {@link Runnable} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static Runnable runnableWithTracingAndMdc(Runnable runnable, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new RunnableWithTracingAndMdcSupport(runnable, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link BiFunction} that wraps the given original so that the given {@link ChannelHandlerContext}'s * distributed tracing and MDC information is registered with the thread and therefore available during execution * and unregistered after execution. */ public static <T, U, R> BiFunction<T, U, R> biFunctionWithTracingAndMdc(BiFunction<T, U, R> fn, ChannelHandlerContext ctx) { return new BiFunctionWithTracingAndMdcSupport<>(fn, ctx); }
/** * @return A {@link Consumer} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <T> Consumer<T> consumerWithTracingAndMdc(Consumer<T> consumer, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new ConsumerWithTracingAndMdcSupport<>(consumer, threadInfoToLink); }
/** * @return A {@link Function} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <T, U> Function<T, U> functionWithTracingAndMdc(Function<T, U> fn, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new FunctionWithTracingAndMdcSupport<>(fn, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Callable} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <U> Callable<U> callableWithTracingAndMdc(Callable<U> callable, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new CallableWithTracingAndMdcSupport<>(callable, threadInfoToLink); }
/** * @return A {@link Supplier} that wraps the given distributed tracing and MDC information is registered with the * thread and therefore available during execution and unregistered after execution. */ public static <U> Supplier<U> supplierWithTracingAndMdc(Supplier<U> supplier, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new SupplierWithTracingAndMdcSupport<>(supplier, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Runnable} that wraps the given original so that the given {@link ChannelHandlerContext}'s * distributed tracing and MDC information is registered with the thread and therefore available during execution * and unregistered after execution. */ public static Runnable runnableWithTracingAndMdc(Runnable runnable, ChannelHandlerContext ctx) { return new RunnableWithTracingAndMdcSupport(runnable, ctx); }
/** * @return A {@link BiFunction} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <T, U, R> BiFunction<T, U, R> biFunctionWithTracingAndMdc(BiFunction<T, U, R> fn, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new BiFunctionWithTracingAndMdcSupport<>(fn, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Consumer} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <T> Consumer<T> consumerWithTracingAndMdc(Consumer<T> consumer, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new ConsumerWithTracingAndMdcSupport<>(consumer, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Callable} that wraps the given original so that the given distributed tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. */ public static <U> Callable<U> callableWithTracingAndMdc(Callable<U> callable, Deque<Span> distributedTraceStackToLink, Map<String, String> mdcContextMapToLink) { return new CallableWithTracingAndMdcSupport<>(callable, distributedTraceStackToLink, mdcContextMapToLink); }
/** * @return A {@link Callable} that wraps the given original so that the given {@link ChannelHandlerContext}'s * distributed tracing and MDC information is registered with the thread and therefore available during execution * and unregistered after execution. */ public static <U> Callable<U> callableWithTracingAndMdc(Callable<U> callable, ChannelHandlerContext ctx) { return new CallableWithTracingAndMdcSupport<>(callable, ctx); }