Interface FtHandlerTyped<T>

Type Parameters:
T - type of result
All Known Subinterfaces:
Fallback<T>

public interface FtHandlerTyped<T>
A typed fault tolerance handler, to allow combination of multiple handlers without losing type information.
  • Method Summary

    Modifier and Type
    Method
    Description
    invoke(Supplier<? extends T> supplier)
    Invoke this fault tolerance handler on a supplier of a result.
  • Method Details

    • invoke

      T invoke(Supplier<? extends T> supplier)
      Invoke this fault tolerance handler on a supplier of a result. This method blocks until all FT handlers are resolved.
      Parameters:
      supplier - that provides the initial value for processing; depending on handler type, the supplier may be called multiple times
      Returns:
      a value with result after the fault tolerance operations
      Throws:
      RuntimeException - in case the underlying supplier threw an exception, or one of the FT handlers failed