public static class IntervalRetryScheduler.Builder extends Object
IntervalRetryScheduler
.
The retryInterval
, maxRetryCount
and ScheduledExecutorService
are
hard requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
IntervalRetryScheduler |
build()
Initializes a
IntervalRetryScheduler as specified through this Builder. |
IntervalRetryScheduler.Builder |
maxRetryCount(int maxRetryCount)
Sets the maximum number of retries allowed for a single command.
|
IntervalRetryScheduler.Builder |
retryExecutor(ScheduledExecutorService retryExecutor)
Sets the
ScheduledExecutorService used to schedule a command retry. |
IntervalRetryScheduler.Builder |
retryInterval(int retryInterval)
Sets the retry interval in milliseconds at which to schedule a retry.
|
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public IntervalRetryScheduler.Builder retryInterval(int retryInterval)
retryInterval
- an int
specifying the retry interval in milliseconds at which to schedule a
retrypublic IntervalRetryScheduler.Builder maxRetryCount(int maxRetryCount)
maxRetryCount
- an int
specifying the maximum number of retries allowed for a single commandpublic IntervalRetryScheduler.Builder retryExecutor(ScheduledExecutorService retryExecutor)
ScheduledExecutorService
used to schedule a command retry.retryExecutor
- a ScheduledExecutorService
used to schedule a command retrypublic IntervalRetryScheduler build()
IntervalRetryScheduler
as specified through this Builder.IntervalRetryScheduler
as specified through this Builderprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2018. All rights reserved.