Class ScopedValueInheritance
java.lang.Object
org.jdrupes.builder.core.ScopedValueInheritance
Supports inheriting scoped values in a task submitted to an
executor service.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(ScopedValue<?> value) Adds the value to the registry.static <T> Future<T> submitTo(ExecutorService executor, Callable<T> task) Executes the task with the registered scoped values inherited from the current thread.
-
Method Details
-
add
Adds the value to the registry.- Parameters:
value- the value
-
submitTo
Executes the task with the registered scoped values inherited from the current thread.- Type Parameters:
T- the generic type- Parameters:
executor- the executortask- the task- Returns:
- the future
-