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 Type
    Method
    Description
    static Invoker
    Creates a direct invoker.
    default <E extends Exception>
    void
    invoke(org.wildfly.common.function.ExceptionRunnable<E> action)
    Invokes the specified action
    <R, E extends Exception>
    R
    invoke(org.wildfly.common.function.ExceptionSupplier<R,E> action)
    Invokes the specified action
    static Invoker
    retrying(List<Duration> intervals)
    Creates 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 E
      Invokes the specified action
      Parameters:
      action - an action to be invoked
      Returns:
      the result of the action
      Throws:
      Exception - if invocation fails
      E
    • 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 fails
      E
    • direct

      static Invoker direct()
      Creates a direct invoker.
      Returns:
      a new invoker instance.
    • retrying

      static Invoker retrying(List<Duration> intervals)
      Creates a retrying invoker, where retries are spaced using the specified backoff intervals.
      Returns:
      a new invoker instance.