Module io.helidon.faulttolerance
Package io.helidon.faulttolerance
Class RetryConfig.BuilderBase<BUILDER extends RetryConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends RetryConfig>
java.lang.Object
io.helidon.faulttolerance.RetryConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
RetryConfig.Builder
- Enclosing interface:
RetryConfig
public abstract static class RetryConfig.BuilderBase<BUILDER extends RetryConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends RetryConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
RetryConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddApplyOn(Class<? extends Throwable> applyOn) These throwables will be considered retriable.addApplyOn(Set<Class<? extends Throwable>> applyOn) These throwables will be considered retriable.These throwables will not be considered retriable, all other will.These throwables will not be considered retriable, all other will.applyOn()These throwables will be considered retriable.These throwables will be considered retriable.intcalls()Number of calls (first try + retries).calls(int calls) Number of calls (first try + retries).Clear all applyOn.Clear existing value of name.Clear existing value of retryPolicy.Clear all skipOn.config()Configuration used to configure this instance.Deprecated.Update builder from configuration (node of this type).delay()Base delay between try and retry.Base delay between try and retry.doubleDelay retry policy factor.delayFactor(double delayFactor) Delay retry policy factor.booleanFlag to enable metrics for this instance.enableMetrics(boolean enableMetrics) Flag to enable metrics for this instance.from(RetryConfig prototype) Update this builder from an existing prototype instance.from(RetryConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.jitter()Jitter forRetry.JitterRetryPolicy.Jitter forRetry.JitterRetryPolicy.name()Name for debugging, error reporting, monitoring.Name for debugging, error reporting, monitoring.Overall timeout of all retries combined.overallTimeout(Duration overallTimeout) Overall timeout of all retries combined.protected voidHandles providers and decorators.Explicitly configured retry policy.retryPolicy(Retry.RetryPolicy retryPolicy) Explicitly configured retry policy.skipOn()These throwables will not be considered retriable, all other will.These throwables will not be considered retriable, all other will.toString()protected voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends RetryConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends RetryConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends RetryConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends RetryConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearName
Clear existing value of name.- Returns:
- updated builder instance
- See Also:
-
name
Name for debugging, error reporting, monitoring.- Parameters:
name- name of this retry- Returns:
- updated builder instance
- See Also:
-
calls
Number of calls (first try + retries).- Parameters:
calls- number of desired calls, must be 1 (means no retries) or higher.- Returns:
- updated builder instance
- See Also:
-
delay
Base delay between try and retry. Defaults to200 ms.- Parameters:
delay- delay between retries (combines with retry policy)- Returns:
- updated builder instance
- See Also:
-
delayFactor
Delay retry policy factor. If unspecified (value of-1), Jitter retry policy would be used, unless jitter is also unspecified.Default when
Retry.DelayingRetryPolicyis used is2.- Parameters:
delayFactor- delay factor for delaying retry policy- Returns:
- updated builder instance
- See Also:
-
jitter
Jitter forRetry.JitterRetryPolicy. If unspecified (value of-1), delaying retry policy is used. If both this value, anddelayFactor()are specified, delaying retry policy would be used.- Parameters:
jitter- jitter- Returns:
- updated builder instance
- See Also:
-
overallTimeout
Overall timeout of all retries combined.- Parameters:
overallTimeout- overall timeout- Returns:
- updated builder instance
- See Also:
-
clearSkipOn
Clear all skipOn.- Returns:
- updated builder instance
- See Also:
-
skipOn
These throwables will not be considered retriable, all other will.- Parameters:
skipOn- throwable classes to skip retries- Returns:
- updated builder instance
- See Also:
-
addSkipOn
These throwables will not be considered retriable, all other will.- Parameters:
skipOn- throwable classes to skip retries- Returns:
- updated builder instance
- See Also:
-
addSkipOn
These throwables will not be considered retriable, all other will.- Parameters:
skipOn- add single throwable classes to skip retries- Returns:
- updated builder instance
- See Also:
-
clearApplyOn
Clear all applyOn.- Returns:
- updated builder instance
- See Also:
-
applyOn
These throwables will be considered retriable.- Parameters:
applyOn- throwable classes to trigger retries- Returns:
- updated builder instance
- See Also:
-
addApplyOn
These throwables will be considered retriable.- Parameters:
applyOn- throwable classes to trigger retries- Returns:
- updated builder instance
- See Also:
-
addApplyOn
These throwables will be considered retriable.- Parameters:
applyOn- add single throwable classes to trigger retries- Returns:
- updated builder instance
- See Also:
-
clearRetryPolicy
Clear existing value of retryPolicy.- Returns:
- updated builder instance
- See Also:
-
retryPolicy
Explicitly configured retry policy.- Parameters:
retryPolicy- retry policy- Returns:
- updated builder instance
- See Also:
-
enableMetrics
Flag 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.- Parameters:
enableMetrics- metrics enabled flag- Returns:
- updated builder instance
- See Also:
-
name
Name for debugging, error reporting, monitoring.- Returns:
- name of this retry
-
calls
public int calls()Number of calls (first try + retries).- Returns:
- number of desired calls, must be 1 (means no retries) or higher.
-
delay
Base delay between try and retry. Defaults to200 ms.- Returns:
- delay between retries (combines with retry policy)
-
delayFactor
public double delayFactor()Delay retry policy factor. If unspecified (value of-1), Jitter retry policy would be used, unless jitter is also unspecified.Default when
Retry.DelayingRetryPolicyis used is2.- Returns:
- delay factor for delaying retry policy
-
jitter
Jitter forRetry.JitterRetryPolicy. If unspecified (value of-1), delaying retry policy is used. If both this value, anddelayFactor()are specified, delaying retry policy would be used.- Returns:
- jitter
-
overallTimeout
Overall timeout of all retries combined.- Returns:
- overall timeout
-
skipOn
These throwables will not be considered retriable, all other will.- Returns:
- throwable classes to skip retries
- See Also:
-
applyOn
These throwables will be considered retriable.- Returns:
- throwable classes to trigger retries
- See Also:
-
retryPolicy
Explicitly configured retry policy.- Returns:
- retry policy
-
enableMetrics
public boolean enableMetrics()Flag 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.- Returns:
- metrics enabled flag
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
Configuration used to configure this instance.- Returns:
- config instance
-
config(io.helidon.config.Config)