Annotation Interface Ft.Fallback

Enclosing class:
Ft

@Retention(CLASS) @Documented @Intercepted @Target(METHOD) public static @interface Ft.Fallback
The annotated method will fallback to the defined method on failure.

The fallback method must have the same signature (types and number of parameters), or have one additional parameter of type Throwable to receive the last exception thrown.

Fault tolerance will add all intermediate exceptions as Throwable.addSuppressed(Throwable).

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Name of the method to fallback to.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Throwable>[]
    List of exception types that this fallback should be executed on.
    Class<? extends Throwable>[]
    List of exceptions that will not execute a fallback.
  • Element Details

    • value

      String value
      Name of the method to fallback to. The method must follow the signature rules defined on this class.
      Returns:
      method name on the same instance (can also be a static method)
    • applyOn

      Class<? extends Throwable>[] applyOn
      List of exception types that this fallback should be executed on.
      Returns:
      throwables that trigger fallback
      Default:
      {java.lang.Throwable.class}
    • skipOn

      Class<? extends Throwable>[] skipOn
      List of exceptions that will not execute a fallback. For these exceptions, the throwable will be propagated to the caller.
      Returns:
      throwables that are re-thrown
      Default:
      {}