Class ContextualConsumer1<T>

java.lang.Object
io.smallrye.context.impl.wrappers.ContextualConsumer1<T>
All Implemented Interfaces:
ContextHolder, Contextualized, ContextualConsumer<T>, Consumer<T>

public class ContextualConsumer1<T> extends Object implements ContextualConsumer<T>
  • Constructor Details

    • ContextualConsumer1

      public ContextualConsumer1(Consumer<T> consumer)
  • Method Details

    • accept

      public void accept(T t)
      Specified by:
      accept in interface Consumer<T>
    • captureThreadLocal

      public void captureThreadLocal(int index, ThreadLocal<Object> threadLocal, Object value)
      Description copied from interface: ContextHolder
      Store a thread local and its current value while capturing, in a way that storage is flattend in the context wrapper with minimal allocation.
      Specified by:
      captureThreadLocal in interface ContextHolder
      Parameters:
      index - the context provider index
      threadLocal - the context provider's threadLocal
      value - the current or cleared value of the threadLocal (depending on ThreadContext settings)