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 long
calculateBackoffTime()
Calculates the back off time and is invoked afterBackoffStrategy.reconfigure(List)
.void
reconfigure(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:BackoffStrategy
Reconfigures 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:
reconfigure
in interfaceBackoffStrategy
- Parameters:
externalTasks
- which have been fetched
-
calculateBackoffTime
public long calculateBackoffTime()
Description copied from interface:BackoffStrategy
Calculates the back off time and is invoked after
BackoffStrategy.reconfigure(List)
.- Specified by:
calculateBackoffTime
in interfaceBackoffStrategy
- Returns:
- the back off time between fetch and lock requests in milliseconds
-
-