/** * @return A {@link Predicate} that wraps the given original so that the <b>current thread's</b> tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. * * <p>NOTE: The current thread's tracing and MDC info will be extracted using {@link * Tracer#getCurrentSpanStackCopy()} and {@link MDC#getCopyOfContextMap()}. */ default <T> Predicate<T> predicateWithTracing(Predicate<T> predicate) { return new PredicateWithTracing<>(predicate); }
/** * @return A {@link Supplier} 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. */ default <U> Supplier<U> supplierWithTracing(Supplier<U> supplier, Deque<Span> spanStackToLink, Map<String, String> mdcContextMapToLink) { return new SupplierWithTracing<>(supplier, spanStackToLink, mdcContextMapToLink); }
/** * @return A {@link Function} that wraps the given original so that the <b>current thread's</b> tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. * * <p>NOTE: The current thread's tracing and MDC info will be extracted using {@link * Tracer#getCurrentSpanStackCopy()} and {@link MDC#getCopyOfContextMap()}. */ default <T, U> Function<T, U> functionWithTracing(Function<T, U> fn) { return new FunctionWithTracing<>(fn); }
/** * @return A {@link BiPredicate} that wraps the given original so that the <b>current thread's</b> tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. * * <p>NOTE: The current thread's tracing and MDC info will be extracted using {@link * Tracer#getCurrentSpanStackCopy()} and {@link MDC#getCopyOfContextMap()}. */ default <T, U> BiPredicate<T, U> biPredicateWithTracing(BiPredicate<T, U> biPredicate) { return new BiPredicateWithTracing<>(biPredicate); }
/** * @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. You can pass in a {@link TracingState} for clearer less verbose code since it extends * {@code Pair<Deque<Span>, Map<String, String>>}. */ default <T, U> BiConsumer<T, U> biConsumerWithTracing( BiConsumer<T, U> biConsumer, Pair<Deque<Span>, Map<String, String>> threadInfoToLink ) { return new BiConsumerWithTracing<>(biConsumer, 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. You can pass in a {@link TracingState} for clearer less verbose code since it extends * {@code Pair<Deque<Span>, Map<String, String>>}. */ default <T, U, R> BiFunction<T, U, R> biFunctionWithTracing( BiFunction<T, U, R> fn, Pair<Deque<Span>, Map<String, String>> threadInfoToLink ) { return new BiFunctionWithTracing<>(fn, threadInfoToLink); }
@Override public void call() throws Throwable { new RunnableWithTracing(null); } })).isInstanceOf(IllegalArgumentException.class);
@Override public void call() throws Throwable { withTracing(null); } })).isInstanceOf(IllegalArgumentException.class);
@Override public void call() throws Throwable { withTracing(null); } })).isInstanceOf(IllegalArgumentException.class);
@Override public void call() throws Throwable { instance.call(); } });
@Override public void call() throws Throwable { instance.run(); } });
/** * @return A {@link Predicate} 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. */ default <T> Predicate<T> predicateWithTracing(Predicate<T> predicate, Deque<Span> spanStackToLink, Map<String, String> mdcContextMapToLink) { return new PredicateWithTracing<>(predicate, spanStackToLink, mdcContextMapToLink); }
/** * @return A {@link BiPredicate} 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. You can pass in a {@link TracingState} for clearer less verbose code since it extends * {@code Pair<Deque<Span>, Map<String, String>>}. */ default <T, U> BiPredicate<T, U> biPredicateWithTracing( BiPredicate<T, U> biPredicate, Pair<Deque<Span>, Map<String, String>> threadInfoToLink ) { return new BiPredicateWithTracing<>(biPredicate, threadInfoToLink); }
/** * @return A {@link Supplier} 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. You can pass in a {@link TracingState} for clearer less verbose code since it extends * {@code Pair<Deque<Span>, Map<String, String>>}. */ default <U> Supplier<U> supplierWithTracing(Supplier<U> supplier, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new SupplierWithTracing<>(supplier, 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. */ default <T, U> Function<T, U> functionWithTracing(Function<T, U> fn, Deque<Span> spanStackToLink, Map<String, String> mdcContextMapToLink) { return new FunctionWithTracing<>(fn, spanStackToLink, mdcContextMapToLink); }
/** * @return A {@link BiConsumer} that wraps the given original so that the <b>current thread's</b> tracing and MDC * information is registered with the thread and therefore available during execution and unregistered after * execution. * * <p>NOTE: The current thread's tracing and MDC info will be extracted using {@link * Tracer#getCurrentSpanStackCopy()} and {@link MDC#getCopyOfContextMap()}. */ default <T, U> BiConsumer<T, U> biConsumerWithTracing(BiConsumer<T, U> biConsumer) { return new BiConsumerWithTracing<>(biConsumer); }
/** * @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. */ default <T, U, R> BiFunction<T, U, R> biFunctionWithTracing(BiFunction<T, U, R> fn, Deque<Span> spanStackToLink, Map<String, String> mdcContextMapToLink) { return new BiFunctionWithTracing<>(fn, spanStackToLink, mdcContextMapToLink); }
@Override public void call() throws Throwable { withTracing(null, spanStackMock, mdcInfoMock); } })).isInstanceOf(IllegalArgumentException.class);
/** * @return A {@link Predicate} 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. You can pass in a {@link TracingState} for clearer less verbose code since it extends * {@code Pair<Deque<Span>, Map<String, String>>}. */ default <T> Predicate<T> predicateWithTracing(Predicate<T> predicate, Pair<Deque<Span>, Map<String, String>> threadInfoToLink) { return new PredicateWithTracing<>(predicate, threadInfoToLink); }
/** * @return A {@link BiPredicate} 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. */ default <T, U> BiPredicate<T, U> biPredicateWithTracing(BiPredicate<T, U> biPredicate, Deque<Span> spanStackToLink, Map<String, String> mdcContextMapToLink) { return new BiPredicateWithTracing<>(biPredicate, spanStackToLink, mdcContextMapToLink); }