Interface Invoker
public interface Invoker
Defines a strategy for invoking a given action.
TODO Replace this with Failsafe
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptionstatic Invokerdirect()Creates a direct invoker.default <E extends Exception>
voidinvoke(org.wildfly.common.function.ExceptionRunnable<E> action) Invokes the specified action<R,E extends Exception>
Rinvoke(org.wildfly.common.function.ExceptionSupplier<R, E> action) Invokes the specified actionstatic InvokerCreates a retrying invoker, where retries are spaced using the specified backoff intervals.
-
Method Details
-
invoke
<R,E extends Exception> R invoke(org.wildfly.common.function.ExceptionSupplier<R, E> action) throws EInvokes the specified action- Parameters:
action- an action to be invoked- Returns:
- the result of the action
- Throws:
Exception- if invocation failsE
-
invoke
default <E extends Exception> void invoke(org.wildfly.common.function.ExceptionRunnable<E> action) throws E Invokes the specified action- Parameters:
action- an action to be invoked- Throws:
Exception- if invocation failsE
-
direct
Creates a direct invoker.- Returns:
- a new invoker instance.
-
retrying
Creates a retrying invoker, where retries are spaced using the specified backoff intervals.- Returns:
- a new invoker instance.
-