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> Prototype.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 Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
Retry
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
-
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.int
calls()
Number of calls (first try + retries).calls
(int calls) Number of calls (first try + retries).Clear existing value of this property.Clear existing value of this property.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).delay()
Base delay between try and retry.Base delay between try and retry.double
Delay retry policy factor.delayFactor
(double delayFactor) Delay retry policy factor.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 void
Handles 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 void
Validates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
Methods inherited from interface io.helidon.builder.api.Prototype.ConfiguredBuilder
discoverService, discoverServices
-
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
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfacePrototype.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 this property.- 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.DelayingRetryPolicy
is 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:
-
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
- throwable classes to skip retries- 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
- throwable classes to trigger retries- Returns:
- updated builder instance
- See Also:
-
clearRetryPolicy
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
retryPolicy
Explicitly configured retry policy.- Parameters:
retryPolicy
- retry policy- Returns:
- updated builder instance
- See Also:
-
name
Name for debugging, error reporting, monitoring.- Returns:
- the name
-
calls
public int calls()Number of calls (first try + retries).- Returns:
- the calls
-
delay
Base delay between try and retry. Defaults to200 ms
.- Returns:
- the delay
-
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.DelayingRetryPolicy
is used is2
.- Returns:
- the delay factor
-
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:
- the jitter
-
overallTimeout
Overall timeout of all retries combined.- Returns:
- the overall timeout
-
skipOn
These throwables will not be considered retriable, all other will.- Returns:
- the skip on
- See Also:
-
applyOn
These throwables will be considered retriable.- Returns:
- the apply on
- See Also:
-
retryPolicy
Explicitly configured retry policy.- Returns:
- the retry policy
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-