java.lang.Object
io.helidon.faulttolerance.FaultTolerance.Builder
- All Implemented Interfaces:
Builder<FaultTolerance.Builder,
,FtHandler> Supplier<FtHandler>
- Enclosing class:
FaultTolerance
public static class FaultTolerance.Builder
extends Object
implements Builder<FaultTolerance.Builder,FtHandler>
A builder used for setting up a customized list of fault tolerance handlers.
-
Method Summary
Modifier and TypeMethodDescriptionAdd a handler to the list.addBreaker
(CircuitBreaker breaker) Add a circuit breaker to the list.addBulkhead
(Bulkhead bulkhead) Add a bulkhead to the list.<U> FaultTolerance.TypedBuilder
<U> addFallback
(Fallback<U> fallback) Add a fallback to the list of handlers.Add a retry to the list.addTimeout
(Timeout timeout) Add a timeout to the list.build()
Build the instance from this builder.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<FaultTolerance.Builder,
FtHandler> - Returns:
- instance of the built type
-
addFallback
Add a fallback to the list of handlers.- Type Parameters:
U
- type of future- Parameters:
fallback
- fallback instance- Returns:
- a new typed builder instance
-
add
Add a handler to the list. This may be a custom handler or one of the predefined ones.- Parameters:
ft
- fault tolerance handler to add- Returns:
- updated builder instance
-
addBulkhead
Add a bulkhead to the list.- Parameters:
bulkhead
- bulkhead handler- Returns:
- updated builder instance
-
addBreaker
Add a circuit breaker to the list.- Parameters:
breaker
- circuit breaker handler- Returns:
- updated builder instance
-
addTimeout
Add a timeout to the list.- Parameters:
timeout
- timeout handler- Returns:
- updated builder instance
-
addRetry
Add a retry to the list.- Parameters:
retry
- retry handler- Returns:
- updated builder instance
-