DESCRIPTION

JCBC-554: Provide retry/backoff utility wrapper

Motivation
----------
Exponential retry and backoff is an useful pattern and it makes sense
to provide an utility class to the SDK users to do that.

Modifications
-------------
Added a Retry utility class that allows to describe a retry pattern by
wrapping the source.
An alternative is to directly use Observable.retryWhen with the new
RetryWhenFunction.

Both approaches take a RetryWithDelayHandler, a class that allows to
describe the retry pattern (max attempts, retry delay and how it grows,
exceptions that can be retried or on the contrary cancel retry cycle).

Added CannotRetryException to denote when a retry attempt failed. It
should always have the Exception that triggered the latest retry as its
cause.

Classes in the util.retry package are marked as Public but Experimental.

Added various unit tests to check the retry behavior.

Result
------
Users can more easily apply a retry pattern to their Observables, either
by calling a wrapping function or passing a RetryWhenFunction to their
Observable's retryWhen operation.

Change-Id: I6d51d834d9f4e1ea101da98d2b1c8ea9369f6c0a


COMMENTS

author: Estrella Humphrey
date: 2015-03-27 11:50:40.011000000

Uploaded patch set 6.

-------------------------------------
author: Estrella Humphrey
date: 2015-03-27 11:51:02.140000000

Patch Set 6: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2015-03-27 12:23:17.325000000

Patch Set 6: Code-Review+2

-------------------------------------
author: Tate Garrett
date: 2015-03-27 12:31:25.327000000

Change has been successfully cherry-picked as 86f4fed4d7d9cb38205c54bf1cf016801ea10b1d

-------------------------------------
