E - the type of error code or exception that occurs when the
operation fails.public interface Retryable<E>
| Modifier and Type | Method and Description |
|---|---|
E |
attempt()
Attempts to execute an operation that may fail under defined
circumstances.
|
void |
recover()
Performs some operation between attempts (e.g., wait for a few seconds).
|
E attempt()
null if the attempt
is successful. Exceptions are returned not thrown so that the type
of error can be specified using generics (throw E causes
a compile-time error).void recover()
attempt() method for resource cleanup.Copyright © 2012–2020 Emory University. All rights reserved.