Interface FtHandler

All Known Subinterfaces:
Bulkhead, CircuitBreaker, Retry, Timeout

public interface FtHandler
A fault tolerance handler. The following handlers do NOT implement this interface:
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    invoke(Supplier<? extends T> supplier)
    Invoke this fault tolerance handler on a supplier of result.
    A name assigned to a handler for debugging, error reporting or configuration purposes.
  • Method Details

    • name

      String name()
      A name assigned to a handler for debugging, error reporting or configuration purposes.
      Returns:
      a non-null name for this handler
    • invoke

      <T> T invoke(Supplier<? extends T> supplier)
      Invoke this fault tolerance handler on a supplier of result.
      Type Parameters:
      T - type of result
      Parameters:
      supplier - that provides the initial value for processing; depending on handler type, the supplier may be called multiple times
      Returns:
      result obtained from the supplier after carrying out fault tolerance rules
      Throws:
      RuntimeException - one of the FT exceptions if the handler fails