Package org.wildfly.clustering.context
Interface ContextualExecutor
- All Superinterfaces:
Executor
Facility for contextual execution.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddefault <T> TExecutes the specified caller with a given context.default <V1,V2> void execute(BiConsumer<V1, V2> consumer, V1 value1, V2 value2) Executes the specified runner.default <V1,V2, R>
Rexecute(BiFunction<V1, V2, R> function, V1 value1, V2 value2) Executes the specified supplier with a given context.default <V> voidExecutes the specified consumer using the specified value.default <V,R> R Executes the specified supplier with a given context.default <T> TExecutes the specified supplier with a given context.<T,V, E extends Exception>
voidexecute(org.wildfly.common.function.ExceptionBiConsumer<T, V, E> consumer, T value1, V value2) Executes the specified runner.<V1,V2, R, E extends Exception>
Rexecute(org.wildfly.common.function.ExceptionBiFunction<V1, V2, R, E> function, V1 value1, V2 value2) Executes the specified supplier with a given context.<V,E extends Exception>
voidexecute(org.wildfly.common.function.ExceptionConsumer<V, E> consumer, V value) Executes the specified consumer using the specified value.<V,R, E extends Exception>
Rexecute(org.wildfly.common.function.ExceptionFunction<V, R, E> function, V value) Executes the specified supplier with a given context.<E extends Exception>
voidexecute(org.wildfly.common.function.ExceptionRunnable<E> runner) Executes the specified runner.<T,E extends Exception>
Texecute(org.wildfly.common.function.ExceptionSupplier<T, E> supplier) Executes the specified supplier with a given context.static ContextualExecutorwithContextProvider(Supplier<Context> provider)
-
Method Details
-
execute
-
execute
<E extends Exception> void execute(org.wildfly.common.function.ExceptionRunnable<E> runner) throws E Executes the specified runner.- Type Parameters:
E- the exception type- Parameters:
runner- a runnable task- Throws:
E- if execution fails
-
execute
Executes the specified consumer using the specified value.- Type Parameters:
V- the consumed value type- Parameters:
consumer- a consumervalue- the consumed value
-
execute
<V,E extends Exception> void execute(org.wildfly.common.function.ExceptionConsumer<V, E> consumer, V value) throws EExecutes the specified consumer using the specified value.- Type Parameters:
V- the consumed value typeE- the exception type- Parameters:
consumer- a consumervalue- the consumed value- Throws:
E- if execution fails
-
execute
Executes the specified runner.- Type Parameters:
V1- the 1st consumed value typeV2- the 2nd consumed value type- Parameters:
consumer- a consumervalue1- the 1st consumed valuevalue2- the 2nd consumed value
-
execute
<T,V, void executeE extends Exception> (org.wildfly.common.function.ExceptionBiConsumer<T, V, throws EE> consumer, T value1, V value2) Executes the specified runner.- Type Parameters:
T- the 1st consumed value typeV- the 2nd consumed value typeE- the exception type- Parameters:
consumer- a consumervalue1- the 1st consumed valuevalue2- the 2nd consumed value- Throws:
E- if execution fails
-
execute
Executes the specified caller with a given context.- Type Parameters:
T- the return type- Parameters:
caller- a callable task- Returns:
- the result of the caller
- Throws:
Exception- if execution fails
-
execute
Executes the specified supplier with a given context.- Type Parameters:
T- the return type- Parameters:
supplier- a supplier task- Returns:
- the result of the supplier
-
execute
<T,E extends Exception> T execute(org.wildfly.common.function.ExceptionSupplier<T, E> supplier) throws EExecutes the specified supplier with a given context.- Type Parameters:
T- the return typeE- the exception type- Parameters:
supplier- a supplier task- Returns:
- the result of the supplier
- Throws:
E- if execution fails
-
execute
Executes the specified supplier with a given context.- Type Parameters:
V- the function parameter typeR- the function return type- Parameters:
function- a function to applyvalue- the function parameter- Returns:
- the result of the function
-
execute
<V,R, R executeE extends Exception> (org.wildfly.common.function.ExceptionFunction<V, R, throws EE> function, V value) Executes the specified supplier with a given context.- Type Parameters:
V- the function parameter typeR- the function return typeE- the exception type- Parameters:
function- a function to applyvalue- the function parameter- Returns:
- the result of the function
- Throws:
E- if execution fails
-
execute
Executes the specified supplier with a given context.- Type Parameters:
V1- the 1st function parameter typeV2- the 2nd function parameter typeR- the function return type- Parameters:
function- a function to applyvalue1- the 1st function parametervalue2- the 2nd function parameter- Returns:
- the result of the function
-
execute
<V1,V2, R executeR, E extends Exception> (org.wildfly.common.function.ExceptionBiFunction<V1, V2, throws ER, E> function, V1 value1, V2 value2) Executes the specified supplier with a given context.- Type Parameters:
V1- the 1st function parameter typeV2- the 2nd function parameter typeR- the function return typeE- the exception type- Parameters:
function- a function to applyvalue1- the 1st function parametervalue2- the 2nd function parameter- Returns:
- the result of the function
- Throws:
E- if execution fails
-
withContextProvider
-