- java.lang.Object
-
- io.helidon.config.SimpleRetryPolicy.Builder
-
- All Implemented Interfaces:
Builder<SimpleRetryPolicy>
,Supplier<SimpleRetryPolicy>
- Enclosing class:
- SimpleRetryPolicy
public static final class SimpleRetryPolicy.Builder extends Object implements Builder<SimpleRetryPolicy>
Fluent API builder forSimpleRetryPolicy
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleRetryPolicy
build()
Build the instance from this builder.SimpleRetryPolicy.Builder
callTimeout(Duration callTimeout)
Timeout for the individual invocation.SimpleRetryPolicy.Builder
config(Config metaConfig)
Update this builder from meta configuration.SimpleRetryPolicy.Builder
delay(Duration delay)
Delay between the invocations.SimpleRetryPolicy.Builder
delayFactor(double delayFactor)
A delay multiplication factor.SimpleRetryPolicy.Builder
executorService(ScheduledExecutorService executorService)
An executor service to schedule retries and run timed operations on.SimpleRetryPolicy.Builder
overallTimeout(Duration overallTimeout)
Overall timeout.SimpleRetryPolicy.Builder
retries(int retries)
Number of retries (excluding the first invocation).
-
-
-
Method Detail
-
build
public SimpleRetryPolicy build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<SimpleRetryPolicy>
- Returns:
- instance of the built type
-
config
public SimpleRetryPolicy.Builder config(Config metaConfig)
Update this builder from meta configuration.Mandatory
properties
, seeRetryPolicies.repeat(int)
:retries
- typeint
properties
:delay
- typeDuration
, seedelay(Duration)
delay-factor
- typedouble
, seedelayFactor(double)
call-timeout
- typeDuration
, seecallTimeout(Duration)
overall-timeout
- typeDuration
, seeoverallTimeout(Duration)
- Parameters:
metaConfig
- meta configuration used to update this builder- Returns:
- updated builder instance
-
retries
public SimpleRetryPolicy.Builder retries(int retries)
Number of retries (excluding the first invocation).- Parameters:
retries
- how many times to retry- Returns:
- updated builder instance
-
delay
public SimpleRetryPolicy.Builder delay(Duration delay)
Delay between the invocations.- Parameters:
delay
- delay between the invocations- Returns:
- updated builder instance
-
delayFactor
public SimpleRetryPolicy.Builder delayFactor(double delayFactor)
A delay multiplication factor.- Parameters:
delayFactor
- a delay multiplication factor- Returns:
- updated builder instance
-
callTimeout
public SimpleRetryPolicy.Builder callTimeout(Duration callTimeout)
Timeout for the individual invocation.- Parameters:
callTimeout
- a timeout for the individual invocation- Returns:
- updated builder instance
-
overallTimeout
public SimpleRetryPolicy.Builder overallTimeout(Duration overallTimeout)
Overall timeout.- Parameters:
overallTimeout
- an overall timeout- Returns:
- updated builder instance
-
executorService
public SimpleRetryPolicy.Builder executorService(ScheduledExecutorService executorService)
An executor service to schedule retries and run timed operations on.- Parameters:
executorService
- service- Returns:
- updated builder instance
-
-