Package dev.failsafe.event
Class ExecutionEvent
java.lang.Object
dev.failsafe.event.ExecutionEvent
- Direct Known Subclasses:
ExecutionAttemptedEvent
,ExecutionCompletedEvent
,ExecutionScheduledEvent
Encapsulates information about a Failsafe execution.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the number of execution attempts so far, including attempts that are blocked before being executed, such as when aCircuitBreaker
is open.Returns the elapsed time since the last execution attempt began.Returns the elapsed time since initial execution began.int
Gets the number of completed executions so far.Returns the time that the initial execution started, elseOptional.empty()
if an execution has not started yet.boolean
boolean
isRetry()
-
Field Details
-
context
-
-
Constructor Details
-
ExecutionEvent
ExecutionEvent(ExecutionContext<?> context)
-
-
Method Details
-
getElapsedTime
Returns the elapsed time since initial execution began. -
getAttemptCount
public int getAttemptCount()Gets the number of execution attempts so far, including attempts that are blocked before being executed, such as when aCircuitBreaker
is open. Will return0
when the first attempt is in progress or has yet to begin. -
getExecutionCount
public int getExecutionCount()Gets the number of completed executions so far. Executions that are blocked, such as when aCircuitBreaker
is open, are not counted. Will return0
when the first attempt is in progress or has yet to begin. -
getStartTime
Returns the time that the initial execution started, elseOptional.empty()
if an execution has not started yet. -
getElapsedAttemptTime
Returns the elapsed time since the last execution attempt began. -
isFirstAttempt
public boolean isFirstAttempt() -
isRetry
public boolean isRetry()
-