R - result typepublic class ExecutionContext<R> extends Object
| Modifier and Type | Method and Description |
|---|---|
ExecutionContext<R> |
copy() |
int |
getAttemptCount()
Gets the number of execution attempts so far, including attempts that are blocked before being executed, such as
when a
CircuitBreaker is open. |
Duration |
getElapsedAttemptTime()
Returns the elapsed time since the last execution attempt began.
|
Duration |
getElapsedTime()
Returns the elapsed time since initial execution began.
|
int |
getExecutionCount()
Gets the number of completed executions so far.
|
<T extends Throwable> |
getLastFailure()
Returns the last failure that was recorded else
null. |
R |
getLastResult()
Returns the last result that was recorded else
null. |
R |
getLastResult(R 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 been cancelled.
|
boolean |
isFirstAttempt()
|
boolean |
isRetry()
|
String |
toString() |
public Duration getElapsedTime()
public Duration getElapsedAttemptTime()
public int getAttemptCount()
CircuitBreaker is open. Will return 0 when the first
attempt is in progress or has yet to begin.public int getExecutionCount()
CircuitBreaker is open, are not counted. Will return 0 when the first
attempt is in progress or has yet to begin.public <T extends Throwable> T getLastFailure()
null.public R getLastResult()
null.public R getLastResult(R defaultValue)
defaultValue.public Duration getStartTime()
public boolean isCancelled()
public boolean isFirstAttempt()
public boolean isRetry()
public ExecutionContext<R> copy()
Copyright © 2021. All rights reserved.