Class ScopedValueInheritance

java.lang.Object
org.jdrupes.builder.core.ScopedValueInheritance

public final class ScopedValueInheritance extends Object
Supports inheriting scoped values in a task submitted to an executor service.
  • Method Details

    • add

      public static void add(ScopedValue<?> value)
      Adds the value to the registry.
      Parameters:
      value - the value
    • submitTo

      public static <T> Future<T> submitTo(ExecutorService executor, Callable<T> task)
      Executes the task with the registered scoped values inherited from the current thread.
      Type Parameters:
      T - the generic type
      Parameters:
      executor - the executor
      task - the task
      Returns:
      the future