Interface RestartBackoffTimeStrategy
-
- All Known Implementing Classes:
ExponentialDelayRestartBackoffTimeStrategy
,FailureRateRestartBackoffTimeStrategy
,FixedDelayRestartBackoffTimeStrategy
,NoRestartBackoffTimeStrategy
public interface RestartBackoffTimeStrategy
Strategy to decide whether to restart failed tasks and the delay to do the restarting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RestartBackoffTimeStrategy.Factory
The factory to instantiateRestartBackoffTimeStrategy
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRestart()
Returns whether a restart should be conducted.long
getBackoffTime()
Returns the delay to do the restarting.boolean
notifyFailure(Throwable cause)
Notify the strategy about the task failure cause.
-
-
-
Method Detail
-
canRestart
boolean canRestart()
Returns whether a restart should be conducted.- Returns:
- whether a restart should be conducted
-
getBackoffTime
long getBackoffTime()
Returns the delay to do the restarting.- Returns:
- the delay to do the restarting
-
notifyFailure
boolean notifyFailure(Throwable cause)
Notify the strategy about the task failure cause.- Parameters:
cause
- of the task failure- Returns:
- True means that the current failure is the first one after the most-recent failure handling happened, false means that there has been a failure before that was not handled, yet, and the current failure will be considered in a combined failure handling effort.
-
-