public class DefaultRetryPolicy extends java.lang.Object implements RetryPolicy
| 限定符和类型 | 字段和说明 |
|---|---|
static float |
DEFAULT_BACKOFF_MULT
The default backoff multiplier
|
static int |
DEFAULT_MAX_RETRIES
The default number of retries
|
static int |
DEFAULT_TIMEOUT_MS
The default socket timeout in milliseconds
|
| 构造器和说明 |
|---|
DefaultRetryPolicy()
Constructs a new retry policy using the default timeouts.
|
DefaultRetryPolicy(int initialTimeoutMs,
int maxNumRetries,
float backoffMultiplier)
Constructs a new retry policy.
|
| 限定符和类型 | 方法和说明 |
|---|---|
float |
getBackoffMultiplier()
Returns the backoff multiplier for the policy.
|
int |
getCurrentRetryCount()
Returns the current retry count.
|
int |
getCurrentTimeout()
Returns the current timeout.
|
protected boolean |
hasAttemptRemaining()
Returns true if this policy has attempts remaining, false otherwise.
|
void |
retry(VolleyError error)
Prepares for the next retry by applying a backoff to the timeout.
|
public static final int DEFAULT_TIMEOUT_MS
public static final int DEFAULT_MAX_RETRIES
public static final float DEFAULT_BACKOFF_MULT
public DefaultRetryPolicy()
public DefaultRetryPolicy(int initialTimeoutMs,
int maxNumRetries,
float backoffMultiplier)
initialTimeoutMs - The initial timeout for the policy.maxNumRetries - The maximum number of retries.backoffMultiplier - Backoff multiplier for the policy.public int getCurrentTimeout()
getCurrentTimeout 在接口中 RetryPolicypublic int getCurrentRetryCount()
getCurrentRetryCount 在接口中 RetryPolicypublic float getBackoffMultiplier()
public void retry(VolleyError error) throws VolleyError
retry 在接口中 RetryPolicyerror - The error code of the last attempt.VolleyError - In the event that the retry could not be performed (for example if we
ran out of attempts), the passed in error is thrown.protected boolean hasAttemptRemaining()