Package org.camunda.bpm.client.backoff
Class ExponentialBackoffStrategy
- java.lang.Object
-
- org.camunda.bpm.client.backoff.ExponentialBackoffStrategy
-
- All Implemented Interfaces:
BackoffStrategy
public class ExponentialBackoffStrategy extends Object implements BackoffStrategy
Provides an exponential backoff strategy.
- Author:
- Nikola Koevski
-
-
Constructor Summary
Constructors Constructor Description ExponentialBackoffStrategy()ExponentialBackoffStrategy(long initTime, float factor, long maxTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcalculateBackoffTime()Calculates the back off time and is invoked afterBackoffStrategy.reconfigure(List).voidreconfigure(List<ExternalTask> externalTasks)Reconfigures the back off strategy based on the fetched external tasks and is invoked beforeBackoffStrategy.calculateBackoffTime().
-
-
-
Constructor Detail
-
ExponentialBackoffStrategy
public ExponentialBackoffStrategy()
-
ExponentialBackoffStrategy
public ExponentialBackoffStrategy(long initTime, float factor, long maxTime)- Parameters:
initTime- in milliseconds for which the client is suspended after the first requestfactor- is the base of the power by which the waiting time increasesmaxTime- in milliseconds for which the client can be suspended
-
-
Method Detail
-
reconfigure
public void reconfigure(List<ExternalTask> externalTasks)
Description copied from interface:BackoffStrategyReconfigures the back off strategy based on the fetched external tasks and is invoked before
BackoffStrategy.calculateBackoffTime().The implementation might count the amount of invocations and realize a strategy reset.
- Specified by:
reconfigurein interfaceBackoffStrategy- Parameters:
externalTasks- which have been fetched
-
calculateBackoffTime
public long calculateBackoffTime()
Description copied from interface:BackoffStrategyCalculates the back off time and is invoked after
BackoffStrategy.reconfigure(List).- Specified by:
calculateBackoffTimein interfaceBackoffStrategy- Returns:
- the back off time between fetch and lock requests in milliseconds
-
-