- java.lang.Object
- 
- io.helidon.faulttolerance.FaultTolerance
 
- 
 public final class FaultTolerance extends Object System wide fault tolerance configuration and access to a customized sequence of fault tolerance handlers.Fault tolerance provides the following features: - Async- invoke a blocking synchronous call asynchronously in an executor service
- Bulkhead- limit number of parallel requests to a resource
- CircuitBreaker- stop trying to request a failing resource until it becomes available
- Fallback- fall back to another supplier of result in case the usual one fails
- Retry- try to call a supplier again if invocation fails
- Timeout- time out a request if it takes too long
 - See Also:
- config(io.helidon.config.Config),- scheduledExecutor(java.util.function.Supplier),- executor(),- builder()
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFaultTolerance.BuilderA builder used for setting up a customized list of fault tolerance handlers.static classFaultTolerance.TypedBuilder<T>A builder used for fault tolerance handlers that require a specific type to be used, such asFallback.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static FaultTolerance.Builderbuilder()A builder to configure a customized sequence of fault tolerance handlers.static voidconfig(Config config)Configure Helidon wide defaults from a config instance.static voidexecutor(Supplier<? extends ExecutorService> executor)Configure Helidon wide executor service for Fault Tolerance.static booleaninitialized()Mostly used for testing.static voidscheduledExecutor(Supplier<? extends ScheduledExecutorService> executor)Configure Helidon wide scheduled executor service for Fault Tolerance.static <T> FaultTolerance.TypedBuilder<T>typedBuilder()A typed builder to configure a customized sequence of fault tolerance handlers.
 
- 
- 
- 
Method Detail- 
configpublic static void config(Config config) Configure Helidon wide defaults from a config instance.- Parameters:
- config- config to read fault tolerance configuration
 
 - 
executorpublic static void executor(Supplier<? extends ExecutorService> executor) Configure Helidon wide executor service for Fault Tolerance.- Parameters:
- executor- executor service to use, such as for- Async
 
 - 
scheduledExecutorpublic static void scheduledExecutor(Supplier<? extends ScheduledExecutorService> executor) Configure Helidon wide scheduled executor service for Fault Tolerance.- Parameters:
- executor- scheduled executor service to use, such as for- Retryscheduling
 
 - 
initializedpublic static boolean initialized() Mostly used for testing. This class is considered to be initialized if any of its (lazy valued) executors were returned.- Returns:
- boolean indicating whether init took place
 
 - 
builderpublic static FaultTolerance.Builder builder() A builder to configure a customized sequence of fault tolerance handlers.- Returns:
- a new builder
 
 - 
typedBuilderpublic static <T> FaultTolerance.TypedBuilder<T> typedBuilder() A typed builder to configure a customized sequence of fault tolerance handlers.- Type Parameters:
- T- type of result
- Returns:
- a new builder
 
 
- 
 
-