public final class AsyncExecution extends Execution
RetryPolicy.| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Completes the execution and the associated
RecurrentFuture. |
boolean |
complete(Object result)
Attempts to complete the execution and the associated
RecurrentFuture with the result. |
boolean |
complete(Object result,
Throwable failure)
Attempts to complete the execution and the associated
RecurrentFuture with the result and
failure. |
boolean |
retry()
Attempts to retry a failed execution.
|
boolean |
retryFor(Object result)
Attempts to retry a failed execution.
|
boolean |
retryFor(Object result,
Throwable failure)
Attempts to retry a failed execution.
|
boolean |
retryOn(Throwable failure)
Attempts to retry a failed execution.
|
canRetryFor, canRetryFor, canRetryOn, fail, getLastFailure, getLastResult, getWaitMillis, getWaitNanos, isCompletegetElapsedMillis, getElapsedNanos, getExecutions, getStartMillis, getStartNanospublic void complete()
RecurrentFuture.complete in class ExecutionIllegalStateException - if the execution is already completepublic boolean complete(Object result)
RecurrentFuture with the result. Returns true
on success, else false if completion failed and should be retried via retry().complete in class ExecutionIllegalStateException - if the execution is already completepublic boolean complete(Object result, Throwable failure)
RecurrentFuture with the result and
failure. Returns true on success, else false if completion failed and should be retried via
retry().
Note: the execution may be completed even when the failure is not null, such as when the
RetryPolicy does not allow retries for the failure.
IllegalStateException - if the execution is already completepublic boolean retry()
RecurrentFuture.IllegalStateException - if a retry method has already been called or the execution is already completepublic boolean retryFor(Object result)
result, else
returns false and completes the execution and associated RecurrentFuture.IllegalStateException - if a retry method has already been called or the execution is already completepublic boolean retryFor(Object result, Throwable failure)
result and
failure, else returns false and completes the execution and associated RecurrentFuture.IllegalStateException - if a retry method has already been called or the execution is already completepublic boolean retryOn(Throwable failure)
failure, else
returns false and completes the execution and associated RecurrentFuture exceptionally.NullPointerException - if failure is nullIllegalStateException - if a retry method has already been called or the execution is already completeCopyright © 2016. All Rights Reserved.