Class RetryConfig.Builder
java.lang.Object
io.helidon.faulttolerance.RetryConfig.BuilderBase<RetryConfig.Builder, RetryConfig>
io.helidon.faulttolerance.RetryConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<RetryConfig.Builder, RetryConfig>, Builder<RetryConfig.Builder, Retry>, ConfigBuilderSupport.ConfiguredBuilder<RetryConfig.Builder, RetryConfig>, Supplier<Retry>
- Enclosing interface:
RetryConfig
public static class RetryConfig.Builder
extends RetryConfig.BuilderBase<RetryConfig.Builder, RetryConfig>
implements Builder<RetryConfig.Builder, Retry>
Fluent API builder for
Retry.-
Nested Class Summary
Nested classes/interfaces inherited from class RetryConfig.BuilderBase
RetryConfig.BuilderBase.RetryConfigImplModifier 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 RetryConfig.BuilderBase
addApplyOn, addApplyOn, addSkipOn, addSkipOn, applyOn, applyOn, calls, calls, clearApplyOn, clearMaxDelay, clearName, clearRetryPolicy, clearSkipOn, config, config, delay, delay, delayFactor, delayFactor, enableMetrics, enableMetrics, from, from, jitter, jitter, jitterFactor, jitterFactor, maxDelay, maxDelay, name, name, overallTimeout, overallTimeout, preBuildPrototype, retryPolicy, retryPolicy, skipOn, skipOn, toString, validatePrototypeModifier 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, including the initial call and retries, which must be at least1.calls(int calls) Number of calls, including the initial call and retries, which must be at least1.Clear all applyOn.Clear existing value of maxDelay.Clear existing value of name.Clear existing value of retryPolicy.Clear all skipOn.config()Configuration used to configure this instance.Update builder from configuration (node of this type).delay()Non-negative base delay between the initial call and retries, which defaults to200 ms.Non-negative base delay between the initial call and retries, which defaults to200 ms.doubleDelay multiplier that must be-1or finite and non-negative;-1selects2unless either jitter option is configured, and an explicit multiplier is applied before jitter.delayFactor(double delayFactor) Delay multiplier that must be-1or finite and non-negative;-1selects2unless either jitter option is configured, and an explicit multiplier is applied before jitter.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()Absolute random jitter that must bePT-1S(disabled) or non-negative; it cannot be combined withjitter-factor, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.Absolute random jitter that must bePT-1S(disabled) or non-negative; it cannot be combined withjitter-factor, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.doubleRelative random jitter that must be-1(disabled) or from0(inclusive) to1(exclusive); it cannot be combined withjitter, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.jitterFactor(double jitterFactor) Relative random jitter that must be-1(disabled) or from0(inclusive) to1(exclusive); it cannot be combined withjitter, is applied independently afterdelay-factor, does not affect later base-delay calculations, and is capped bymax-delaywhen present.maxDelay()Optional non-negative maximum delay applied after jitter; when absent, the delay is not capped.Optional non-negative maximum delay applied after jitter; when absent, the delay is not capped.name()Name for debugging, error reporting, monitoring.Name for debugging, error reporting, monitoring.Positive overall timeout used to bound the complete retry sequence.overallTimeout(Duration overallTimeout) Positive overall timeout used to bound the complete retry sequence.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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault Retryget()default RetryConfig.Builderidentity()Instance of this builder as the correct type.default RetryConfig.Builderupdate(Consumer<RetryConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault RetryConfig.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<RetryConfig.Builder, RetryConfig>- 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<RetryConfig.Builder, Retry>- Returns:
- instance of the built type
-