public class FailureStrategyBuilder
extends java.lang.Object
FastFailover failure strategies.
Example:
PartialFunction<Throwable, FastFailover.FailureDirective> strategy = FailureStrategyBuilder.
match(IllegalArgumentException.class, e -> FastFailover.fail()).
match(AskTimeoutException.class, e -> FastFailover.failover()).build();
| Modifier and Type | Method and Description |
|---|---|
static <P extends java.lang.Throwable> |
match(java.lang.Class<P> type,
akka.japi.pf.FI.Apply<P,FastFailover.FailureDirective> apply)
Return a new
PFBuilder with a case statement added. |
static <P extends java.lang.Throwable> |
match(java.lang.Class<P> type,
akka.japi.pf.FI.TypedPredicate<P> predicate,
akka.japi.pf.FI.Apply<P,FastFailover.FailureDirective> apply)
Return a new
PFBuilder with a case statement added. |
static akka.japi.pf.PFBuilder<java.lang.Throwable,FastFailover.FailureDirective> |
matchAny(akka.japi.pf.FI.Apply<java.lang.Throwable,FastFailover.FailureDirective> apply)
Return a new
PFBuilder with a case statement added. |
public static <P extends java.lang.Throwable> akka.japi.pf.PFBuilder<java.lang.Throwable,FastFailover.FailureDirective> match(java.lang.Class<P> type, akka.japi.pf.FI.Apply<P,FastFailover.FailureDirective> apply)
PFBuilder with a case statement added.type - a type to match the argument againstapply - an action to apply to the argument if the type matchespublic static <P extends java.lang.Throwable> akka.japi.pf.PFBuilder<java.lang.Throwable,FastFailover.FailureDirective> match(java.lang.Class<P> type, akka.japi.pf.FI.TypedPredicate<P> predicate, akka.japi.pf.FI.Apply<P,FastFailover.FailureDirective> apply)
PFBuilder with a case statement added.type - a type to match the argument againstpredicate - a predicate that will be evaluated on the argument if the type matchesapply - an action to apply to the argument if the type matches and the predicate returns truepublic static akka.japi.pf.PFBuilder<java.lang.Throwable,FastFailover.FailureDirective> matchAny(akka.japi.pf.FI.Apply<java.lang.Throwable,FastFailover.FailureDirective> apply)
PFBuilder with a case statement added.apply - an action to apply to the argument