Module io.helidon.faulttolerance
Package io.helidon.faulttolerance
Class CircuitBreakerConfig.BuilderBase.CircuitBreakerConfigImpl
java.lang.Object
io.helidon.faulttolerance.CircuitBreakerConfig.BuilderBase.CircuitBreakerConfigImpl
- All Implemented Interfaces:
- Prototype.Api,- Prototype.Factory<CircuitBreaker>,- CircuitBreakerConfig,- Supplier<CircuitBreaker>
- Enclosing class:
- CircuitBreakerConfig.BuilderBase<BUILDER extends CircuitBreakerConfig.BuilderBase<BUILDER,- PROTOTYPE>, - PROTOTYPE extends CircuitBreakerConfig> 
protected static class CircuitBreakerConfig.BuilderBase.CircuitBreakerConfigImpl
extends Object
implements CircuitBreakerConfig, Supplier<CircuitBreaker>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.helidon.faulttolerance.CircuitBreakerConfigCircuitBreakerConfig.Builder, CircuitBreakerConfig.BuilderBase<BUILDER extends CircuitBreakerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CircuitBreakerConfig> 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefault error ratio.static final intDefault success threshold.static final intDefault volume.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCircuitBreakerConfigImpl(CircuitBreakerConfig.BuilderBase<?, ?> builder) Create an instance providing a builder.
- 
Method SummaryModifier and TypeMethodDescriptionapplyOn()These throwables will be considered failures.build()Create a new instance of the runtime type from this config object.delay()How long to wait before transitioning from open to half-open state.booleanFlag to enable metrics for this instance.booleanintHow many failures out of 100 will trigger the circuit to open.executor()Executor service to schedule future tasks.get()inthashCode()name()Name of this circuit breaker.skipOn()These throwables will not be considered failures, all other will.intHow many successful calls will close a half-open circuit.toString()intvolume()Rolling window size used to calculate ratio of failed requests.
- 
Field Details- 
DEFAULT_ERROR_RATIOstatic final int DEFAULT_ERROR_RATIODefault error ratio.- See Also:
 
- 
DEFAULT_SUCCESS_THRESHOLDstatic final int DEFAULT_SUCCESS_THRESHOLDDefault success threshold.- See Also:
 
- 
DEFAULT_VOLUMEstatic final int DEFAULT_VOLUMEDefault volume.- See Also:
 
 
- 
- 
Constructor Details- 
CircuitBreakerConfigImplCreate an instance providing a builder.- Parameters:
- builder- extending builder base of this prototype
 
 
- 
- 
Method Details- 
buildDescription copied from interface:Prototype.FactoryCreate a new instance of the runtime type from this config object.- Specified by:
- buildin interface- Prototype.Factory<CircuitBreaker>
- Returns:
- new configured runtime instance
 
- 
get- Specified by:
- getin interface- Supplier<CircuitBreaker>
 
- 
nameDescription copied from interface:CircuitBreakerConfigName of this circuit breaker.- Specified by:
- namein interface- CircuitBreakerConfig
- Returns:
- name
 
- 
delayDescription copied from interface:CircuitBreakerConfigHow long to wait before transitioning from open to half-open state.- Specified by:
- delayin interface- CircuitBreakerConfig
- Returns:
- delay
 
- 
errorRatiopublic int errorRatio()Description copied from interface:CircuitBreakerConfigHow many failures out of 100 will trigger the circuit to open. This is adapted to theCircuitBreakerConfig.volume()used to handle the window of requests.If errorRatio is 40, and volume is 10, 4 failed requests will open the circuit. Default is 60. - Specified by:
- errorRatioin interface- CircuitBreakerConfig
- Returns:
- percent of failure that trigger the circuit to open
- See Also:
 
- 
volumepublic int volume()Description copied from interface:CircuitBreakerConfigRolling window size used to calculate ratio of failed requests. Default is 10.- Specified by:
- volumein interface- CircuitBreakerConfig
- Returns:
- how big a window is used to calculate error errorRatio
- See Also:
 
- 
successThresholdpublic int successThreshold()Description copied from interface:CircuitBreakerConfigHow many successful calls will close a half-open circuit. Nevertheless, the first failed call will open the circuit again. Default is 1.- Specified by:
- successThresholdin interface- CircuitBreakerConfig
- Returns:
- number of calls
 
- 
executorDescription copied from interface:CircuitBreakerConfigExecutor service to schedule future tasks.- Specified by:
- executorin interface- CircuitBreakerConfig
- Returns:
- executor to use
 
- 
skipOnDescription copied from interface:CircuitBreakerConfigThese throwables will not be considered failures, all other will.- Specified by:
- skipOnin interface- CircuitBreakerConfig
- Returns:
- throwable classes to not be considered a failure
- See Also:
 
- 
applyOnDescription copied from interface:CircuitBreakerConfigThese throwables will be considered failures.- Specified by:
- applyOnin interface- CircuitBreakerConfig
- Returns:
- throwable classes to be considered a failure
- See Also:
 
- 
enableMetricspublic boolean enableMetrics()Description copied from interface:CircuitBreakerConfigFlag to enable metrics for this instance. The value of this flag is combined with the global config entryFaultTolerance.FT_METRICS_DEFAULT_ENABLED. If either of these flags istrue, then metrics will be enabled for the instance.- Specified by:
- enableMetricsin interface- CircuitBreakerConfig
- Returns:
- metrics enabled flag
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
 
-