Package org.wildfly.clustering.context
Class ContextReferenceExecutor<C>
- java.lang.Object
-
- org.wildfly.clustering.context.ContextReferenceExecutor<C>
-
- All Implemented Interfaces:
Executor,ContextualExecutor,Contextualizer
public class ContextReferenceExecutor<C> extends Object implements ContextualExecutor
Contextual executor based on a context reference.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description ContextReferenceExecutor(C targetContext, ContextReference<C> reference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(Runnable runner)<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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.clustering.context.ContextualExecutor
contextualize, contextualize, contextualize, contextualize, contextualize
-
-
-
-
Constructor Detail
-
ContextReferenceExecutor
public ContextReferenceExecutor(C targetContext, ContextReference<C> reference)
-
-
Method Detail
-
execute
public <E extends Exception> void execute(org.wildfly.common.function.ExceptionRunnable<E> runner) throws E extends Exception
Description copied from interface:ContextualExecutorExecutes the specified runner.- Specified by:
executein interfaceContextualExecutor- Type Parameters:
E- the exception type- Parameters:
runner- a runnable task- Throws:
E- if execution failsE extends Exception
-
execute
public <T> T execute(Callable<T> caller) throws Exception
Description copied from interface:ContextualExecutorExecutes the specified caller with a given context.- Specified by:
executein interfaceContextualExecutor- Type Parameters:
T- the return type- Parameters:
caller- a callable task- Returns:
- the result of the caller
- Throws:
Exception- if execution fails
-
execute
public <T> T execute(Supplier<T> supplier)
Description copied from interface:ContextualExecutorExecutes the specified supplier with a given context.- Specified by:
executein interfaceContextualExecutor- Type Parameters:
T- the return type- Parameters:
supplier- a supplier task- Returns:
- the result of the supplier
-
execute
public <T,E extends Exception> T execute(org.wildfly.common.function.ExceptionSupplier<T,E> supplier) throws E extends Exception
Description copied from interface:ContextualExecutorExecutes the specified supplier with a given context.- Specified by:
executein interfaceContextualExecutor- 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
-
-