Package org.wildfly.clustering.context
Interface ContextualExecutor
-
- All Superinterfaces:
Contextualizer,Executor
- All Known Implementing Classes:
ContextReferenceExecutor
public interface ContextualExecutor extends Contextualizer, Executor
Facility for contextual execution.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Runnablecontextualize(Runnable runner)Decorates the specified runner with a given context.default <T> Callable<T>contextualize(Callable<T> caller)Decorates the specified caller with a given context.default <T> Supplier<T>contextualize(Supplier<T> supplier)Decorates the specified supplier with a given context.default <E extends Exception>
org.wildfly.common.function.ExceptionRunnable<E>contextualize(org.wildfly.common.function.ExceptionRunnable<E> runner)Decorates the specified runner with a given context.default <T,E extends Exception>
org.wildfly.common.function.ExceptionSupplier<T,E>contextualize(org.wildfly.common.function.ExceptionSupplier<T,E> supplier)Decorates the specified supplier with a given context.<T> Texecute(Callable<T> caller)Executes the specified caller with a given context.<T> Texecute(Supplier<T> supplier)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.
-
-
-
Method Detail
-
execute
<E extends Exception> void execute(org.wildfly.common.function.ExceptionRunnable<E> runner) throws E extends Exception
Executes the specified runner.- Type Parameters:
E- the exception type- Parameters:
runner- a runnable task- Throws:
E- if execution failsE extends Exception
-
execute
<T> T execute(Callable<T> caller) throws Exception
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
<T> T execute(Supplier<T> supplier)
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 E extends Exception
Executes 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 failsE extends Exception
-
contextualize
default Runnable contextualize(Runnable runner)
Description copied from interface:ContextualizerDecorates the specified runner with a given context.- Specified by:
contextualizein interfaceContextualizer- Parameters:
runner- a runnable task- Returns:
- a contextual runner
-
contextualize
default <E extends Exception> org.wildfly.common.function.ExceptionRunnable<E> contextualize(org.wildfly.common.function.ExceptionRunnable<E> runner)
Description copied from interface:ContextualizerDecorates the specified runner with a given context.- Specified by:
contextualizein interfaceContextualizer- Type Parameters:
E- the exception type- Parameters:
runner- a runnable task- Returns:
- a contextual runner
-
contextualize
default <T> Callable<T> contextualize(Callable<T> caller)
Description copied from interface:ContextualizerDecorates the specified caller with a given context.- Specified by:
contextualizein interfaceContextualizer- Type Parameters:
T- the return type- Returns:
- a contextual caller
-
contextualize
default <T> Supplier<T> contextualize(Supplier<T> supplier)
Description copied from interface:ContextualizerDecorates the specified supplier with a given context.- Specified by:
contextualizein interfaceContextualizer- Type Parameters:
T- the return type- Returns:
- a contextual supplier
-
contextualize
default <T,E extends Exception> org.wildfly.common.function.ExceptionSupplier<T,E> contextualize(org.wildfly.common.function.ExceptionSupplier<T,E> supplier)
Description copied from interface:ContextualizerDecorates the specified supplier with a given context.- Specified by:
contextualizein interfaceContextualizer- Type Parameters:
T- the return typeE- the exception type- Returns:
- a contextual supplier
-
-