Class CircuitBreakerConfig.Builder
java.lang.Object
io.helidon.faulttolerance.CircuitBreakerConfig.BuilderBase<CircuitBreakerConfig.Builder, CircuitBreakerConfig>
io.helidon.faulttolerance.CircuitBreakerConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<CircuitBreakerConfig.Builder, CircuitBreakerConfig>, Builder<CircuitBreakerConfig.Builder, CircuitBreaker>, ConfigBuilderSupport.ConfiguredBuilder<CircuitBreakerConfig.Builder, CircuitBreakerConfig>, Supplier<CircuitBreaker>
- Enclosing interface:
CircuitBreakerConfig
public static class CircuitBreakerConfig.Builder
extends CircuitBreakerConfig.BuilderBase<CircuitBreakerConfig.Builder, CircuitBreakerConfig>
implements Builder<CircuitBreakerConfig.Builder, CircuitBreaker>
Fluent API builder for
CircuitBreaker.-
Nested Class Summary
Nested classes/interfaces inherited from class CircuitBreakerConfig.BuilderBase
CircuitBreakerConfig.BuilderBase.CircuitBreakerConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create an instance from this builder.Create an instance of the prototype.Methods inherited from class CircuitBreakerConfig.BuilderBase
addApplyOn, addApplyOn, addSkipOn, addSkipOn, applyOn, applyOn, clearApplyOn, clearExecutor, clearName, clearSkipOn, config, config, delay, delay, enableMetrics, enableMetrics, errorRatio, errorRatio, executor, executor, from, from, name, name, preBuildPrototype, skipOn, skipOn, successThreshold, successThreshold, toString, validatePrototype, volume, volumeModifier and TypeMethodDescriptionaddApplyOn(Class<? extends Throwable> applyOn) These throwables will be considered failures.addApplyOn(Set<Class<? extends Throwable>> applyOn) These throwables will be considered failures.These throwables will not be considered failures, all other will.These throwables will not be considered failures, all other will.applyOn()These throwables will be considered failures.These throwables will be considered failures.Clear all applyOn.Clear existing value of executor.Clear existing value of name.Clear all skipOn.config()Configuration used to configure this instance.Update builder from configuration (node of this type).delay()How long to wait before transitioning from open to half-open state; must not be negative and must be small enough to represent in milliseconds.How long to wait before transitioning from open to half-open state; must not be negative and must be small enough to represent in milliseconds.booleanFlag to enable metrics for this instance.enableMetrics(boolean enableMetrics) Flag to enable metrics for this instance.intHow many failures out of 100 will trigger the circuit to open; must be between 1 and 100, inclusive, and its product with the configured volume must not exceed 2,147,483,647.errorRatio(int errorRatio) How many failures out of 100 will trigger the circuit to open; must be between 1 and 100, inclusive, and its product with the configured volume must not exceed 2,147,483,647.executor()Executor service to schedule future tasks.executor(ExecutorService executor) Executor service to schedule future tasks.from(CircuitBreakerConfig prototype) Update this builder from an existing prototype instance.from(CircuitBreakerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.name()Name of this circuit breaker.Name of this circuit breaker.protected voidHandles providers and decorators.skipOn()These throwables will not be considered failures, all other will.These throwables will not be considered failures, all other will.intHow many successful calls will close a half-open circuit; must be at least 1.successThreshold(int successThreshold) How many successful calls will close a half-open circuit; must be at least 1.toString()protected voidValidates required properties.intvolume()Rolling window size used to calculate ratio of failed requests; must be at least 1 and its product with the configured error ratio must not exceed 2,147,483,647.volume(int volume) Rolling window size used to calculate ratio of failed requests; must be at least 1 and its product with the configured error ratio must not exceed 2,147,483,647.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault CircuitBreakerget()default CircuitBreakerConfig.Builderidentity()Instance of this builder as the correct type.default CircuitBreakerConfig.Builderupdate(Consumer<CircuitBreakerConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault CircuitBreakerConfig.Builderself()Instance of this builder as the correct type.
-
Method Details
-
buildPrototype
Create an instance of the prototype. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildPrototypein interfacePrototype.Builder<CircuitBreakerConfig.Builder, CircuitBreakerConfig>- Returns:
- an instance of the setup object created from this builder
-
build
Create an instance from this builder. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildin interfaceBuilder<CircuitBreakerConfig.Builder, CircuitBreaker>- Returns:
- instance of the built type
-