|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectyass.backoff.BackoffManager
yass.backoff.GeometricProgressionBackoffManager
public class GeometricProgressionBackoffManager
Backoff manager in which the sequence of backoff periods forms a geometric progression. This class generates similar behaviour to that of ExponentialBackoffManager but with a different style of parameterisation which may be more convenient under some circumstances.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class yass.backoff.BackoffManager |
|---|
BackoffManager.BackoffState |
| Field Summary | |
|---|---|
protected int |
backoffCycleLimit
The maximum permitted number of backoff cycles before timeout |
protected double |
ratio
The ratio by which the previous backoff period is multiplied to find the next backoff period |
| Fields inherited from class yass.backoff.BackoffManager |
|---|
backoffCyclesCompleted, currentBackoffPeriod, currentBackoffRemaining, initialBackoffPeriod, nextBackoffPeriod, state |
| Constructor Summary | |
|---|---|
GeometricProgressionBackoffManager(double initialBackoffPeriod,
double ratio,
int backoffCycleLimit)
Creates a new instance of GeometricProgressionBackoffManager |
|
| Method Summary | |
|---|---|
boolean |
attemptBackoff()
Attempts to initiate a new backoff period, the duration of which is the next term in the geometric sequence |
BackoffManager |
clonePrototype()
Obtains a new GeometricProgressionBackoffManager instance, using the called instance as a template instance |
int |
getBackoffCycleLimit()
Obtains the maximum permitted number of backoff cycles before timeout |
double |
getRatio()
Obtains the ratio by which adjacent terms in the geometric sequence of backoff times differ |
| Methods inherited from class yass.backoff.BackoffManager |
|---|
advanceTime, checkBackoffStatePreconditions, getBackoffCyclesCompleted, getCurrentBackoffPeriod, getCurrentBackoffRemaining, getInitialBackoffPeriod, getNextBackoffPeriod, getState, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double ratio
protected int backoffCycleLimit
| Constructor Detail |
|---|
public GeometricProgressionBackoffManager(double initialBackoffPeriod,
double ratio,
int backoffCycleLimit)
GeometricProgressionBackoffManager
initialBackoffPeriod - the initial backoff period, in secondsratio - ratio by which adjacent terms in geometric sequence of
backoff times differbackoffCycleLimit - maximum permitted number of backoff cycles
before timeout| Method Detail |
|---|
public BackoffManager clonePrototype()
clonePrototype in class BackoffManager
public boolean attemptBackoff()
throws BackoffException
attemptBackoff in class BackoffManagerBackoffException - if called when the backoff manager is not
currently in a READY statepublic double getRatio()
public int getBackoffCycleLimit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||