Class ContextualSupplier2<R>

java.lang.Object
io.smallrye.context.impl.wrappers.ContextualSupplier2<R>
All Implemented Interfaces:
ContextHolder, Contextualized, ContextualSupplier<R>, Supplier<R>

public final class ContextualSupplier2<R> extends Object implements ContextualSupplier<R>
  • Constructor Details

    • ContextualSupplier2

      public ContextualSupplier2(Supplier<R> supplier)
  • Method Details

    • get

      public R get()
      Specified by:
      get in interface Supplier<R>
    • 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)