类 DefaultRetryPolicy
java.lang.Object
com.android.volley.DefaultRetryPolicy
- 所有已实现的接口:
RetryPolicy
Default retry policy for requests.
-
字段概要
字段修饰符和类型字段说明static final floatThe default backoff multiplierstatic final intThe default number of retriesstatic final intThe default socket timeout in milliseconds -
构造器概要
构造器构造器说明Constructs a new retry policy using the default timeouts.DefaultRetryPolicy(int initialTimeoutMs, int maxNumRetries, float backoffMultiplier) Constructs a new retry policy. -
方法概要
修饰符和类型方法说明floatReturns the backoff multiplier for the policy.intReturns the current retry count.intReturns the current timeout.protected booleanReturns true if this policy has attempts remaining, false otherwise.voidretry(VolleyError error) Prepares for the next retry by applying a backoff to the timeout.
-
字段详细资料
-
DEFAULT_TIMEOUT_MS
public static final int DEFAULT_TIMEOUT_MSThe default socket timeout in milliseconds- 另请参阅:
-
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIESThe default number of retries- 另请参阅:
-
DEFAULT_BACKOFF_MULT
public static final float DEFAULT_BACKOFF_MULTThe default backoff multiplier- 另请参阅:
-
-
构造器详细资料
-
DefaultRetryPolicy
public DefaultRetryPolicy()Constructs a new retry policy using the default timeouts. -
DefaultRetryPolicy
public DefaultRetryPolicy(int initialTimeoutMs, int maxNumRetries, float backoffMultiplier) Constructs a new retry policy.- 参数:
initialTimeoutMs- The initial timeout for the policy.maxNumRetries- The maximum number of retries.backoffMultiplier- Backoff multiplier for the policy.
-
-
方法详细资料
-
getCurrentTimeout
public int getCurrentTimeout()Returns the current timeout.- 指定者:
getCurrentTimeout在接口中RetryPolicy
-
getCurrentRetryCount
public int getCurrentRetryCount()Returns the current retry count.- 指定者:
getCurrentRetryCount在接口中RetryPolicy
-
getBackoffMultiplier
public float getBackoffMultiplier()Returns the backoff multiplier for the policy. -
retry
Prepares for the next retry by applying a backoff to the timeout.- 指定者:
retry在接口中RetryPolicy- 参数:
error- 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.
-
hasAttemptRemaining
protected boolean hasAttemptRemaining()Returns true if this policy has attempts remaining, false otherwise.
-