public abstract class RetryPolicy
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RetryPolicy.RetryCancelled
Cancelled retry exception
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
startRetryTime |
| Constructor and Description |
|---|
RetryPolicy(int startRetryTime)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
retry(ConnectionState state,
RetryHandler retryHandler,
ConnectionFailHandler failHandler)
Does the retry.
|
abstract boolean |
shouldRetry(ConnectionState connectionState)
Should another retry be attempted according to the policy
|
public RetryPolicy(int startRetryTime)
startRetryTime - start milliseconds before trying retrypublic final void retry(ConnectionState state, RetryHandler retryHandler, ConnectionFailHandler failHandler) throws RetryPolicy.RetryCancelled
state - of connectionretryHandler - handles the retry itselffailHandler - handles the failRetryPolicy.RetryCancelled - if retry is cancelledpublic abstract boolean shouldRetry(ConnectionState connectionState)
connectionState - current connection state