Package org.wildfly.clustering.context
Interface ContextualExecutor
- All Superinterfaces:
Contextualizer,Executor
- All Known Implementing Classes:
ContextReferenceExecutor
Facility for contextual execution.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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> TExecutes the specified caller with a given context.<T> TExecutes 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 Details
-
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 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
-
contextualize
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
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
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
-