Package io.smallrye.faulttolerance.api
Interface FaultTolerance.Builder.FallbackBuilder<T,R>
-
- Enclosing interface:
- FaultTolerance.Builder<T,R>
public static interface FaultTolerance.Builder.FallbackBuilder<T,R>Configures a fallback.- See Also:
@Fallback
-
-
Method Summary
-
-
-
Method Detail
-
handler
FaultTolerance.Builder.FallbackBuilder<T,R> handler(Supplier<T> value)
Sets the fallback handler in the form of a fallback valueSupplier.- Parameters:
value- the fallback value supplier, must not benull- Returns:
- this fallback builder
-
handler
FaultTolerance.Builder.FallbackBuilder<T,R> handler(Function<Throwable,T> value)
Sets the fallback handler in the form of aFunctionthat transforms the exception to the fallback value.- Parameters:
value- the fallback value function, must not benull- Returns:
- this fallback builder
-
applyOn
FaultTolerance.Builder.FallbackBuilder<T,R> applyOn(Collection<Class<? extends Throwable>> value)
Sets the set of exception types considered failure. Defaults to all exceptions (Throwable).- Parameters:
value- collection of exception types, must not benull- Returns:
- this fallback builder
- See Also:
@Fallback.applyOn
-
applyOn
default FaultTolerance.Builder.FallbackBuilder<T,R> applyOn(Class<? extends Throwable> value)
Equivalent toapplyOn(Collections.singleton(value)).- Parameters:
value- an exception class, must not benull- Returns:
- this fallback builder
-
skipOn
FaultTolerance.Builder.FallbackBuilder<T,R> skipOn(Collection<Class<? extends Throwable>> value)
Sets the set of exception types considered success. Defaults to no exception (empty set).- Parameters:
value- collection of exception types, must not benull- Returns:
- this fallback builder
- See Also:
@Fallback.skipOn
-
skipOn
default FaultTolerance.Builder.FallbackBuilder<T,R> skipOn(Class<? extends Throwable> value)
Equivalent toskipOn(Collections.singleton(value)).- Parameters:
value- an exception class, must not benull- Returns:
- this fallback builder
-
done
FaultTolerance.Builder<T,R> done()
Returns the original fault tolerance builder.- Returns:
- the original fault tolerance builder
-
with
default FaultTolerance.Builder.FallbackBuilder<T,R> with(Consumer<FaultTolerance.Builder.FallbackBuilder<T,R>> consumer)
-
-