Package net.toddm.comm
Interface RetryPolicyProvider
-
- All Known Implementing Classes:
DefaultRetryPolicyProvider
public interface RetryPolicyProviderRetry policy providers implement this interface in order to control retry behavior such as if and when a request should be retried after a network failure, retry frequencies and limits, etc.- Author:
- Todd S. Murchison
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RetryProfileshouldRetry(Work work, Exception error)Called by theCommManagerwhen network request work results in an exception.RetryProfileshouldRetry(Work work, Response response)Called by theCommManagerwhen network request work results in a response back from the remote resource.
-
-
-
Method Detail
-
shouldRetry
RetryProfile shouldRetry(Work work, Exception error)
Called by theCommManagerwhen network request work results in an exception. TheRetryProfileinstance returned is used to determine if and how the request should be retried.- Parameters:
work- TheWorkthat resulted in the givenException.error- TheExceptionthrown while attempting the givenRequestwork.- Returns:
- A
RetryProfileinstance used to determine if and how the request should be retried.
-
shouldRetry
RetryProfile shouldRetry(Work work, Response response)
Called by theCommManagerwhen network request work results in a response back from the remote resource. TheRetryProfileinstance returned is used to determine if and how the request should be retried.- Parameters:
work- TheWorkthat resulted in the givenResponse.response- TheResponseinstance resulting from the givenRequestwork.- Returns:
- A
RetryProfileinstance used to determine if and how the request should be retried.
-
-