Interface RestartBackoffTimeStrategy
-
- All Known Implementing Classes:
ExponentialDelayRestartBackoffTimeStrategy,FailureRateRestartBackoffTimeStrategy,FixedDelayRestartBackoffTimeStrategy,NoRestartBackoffTimeStrategy
public interface RestartBackoffTimeStrategyStrategy 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 interfaceRestartBackoffTimeStrategy.FactoryThe factory to instantiateRestartBackoffTimeStrategy.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanRestart()Returns whether a restart should be conducted.longgetBackoffTime()Returns the delay to do the restarting.voidnotifyFailure(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
void notifyFailure(Throwable cause)
Notify the strategy about the task failure cause.- Parameters:
cause- of the task failure
-
-