public class ExecutionContext extends Object
Modifier and Type | Method and Description |
---|---|
ExecutionContext |
copy() |
int |
getAttemptCount()
Gets the number of completed execution attempts so far.
|
Duration |
getElapsedAttemptTime()
Returns the elapsed time since the last execution attempt began.
|
Duration |
getElapsedTime()
Returns the elapsed time since initial execution began.
|
<T extends Throwable> |
getLastFailure()
Returns the last failure that was recorded else
null . |
<T> T |
getLastResult()
Returns the last result that was recorded else
null . |
<T> T |
getLastResult(T defaultValue)
Returns the last result that was recorded else the
defaultValue . |
Duration |
getStartTime()
Returns the time that the initial execution started.
|
boolean |
isCancelled()
Returns whether the execution has ben cancelled.
|
boolean |
isFirstAttempt()
|
boolean |
isRetry()
|
String |
toString() |
public Duration getElapsedTime()
public Duration getElapsedAttemptTime()
public int getAttemptCount()
0
when the first attempt is in
progress.public <T extends Throwable> T getLastFailure()
null
.public <T> T getLastResult()
null
.public <T> T getLastResult(T defaultValue)
defaultValue
.public Duration getStartTime()
public boolean isCancelled()
public boolean isFirstAttempt()
public boolean isRetry()
public ExecutionContext copy()
Copyright © 2020. All rights reserved.