Package dev.failsafe
Class CallImpl<R>
java.lang.Object
dev.failsafe.CallImpl<R>
- Type Parameters:
R
- result type
- All Implemented Interfaces:
Call<R>
A call implementation that delegates to an execution.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) Cancels a synchronous execution and calls the most recentcancelCallback
that was registered.execute()
Executes the call until a successful result is returned or the configured policies are exceeded.boolean
Returns whether the call has been cancelled.(package private) void
setExecution
(SyncExecutionImpl<R> execution)
-
Field Details
-
execution
-
-
Constructor Details
-
CallImpl
CallImpl()
-
-
Method Details
-
setExecution
-
execute
Description copied from interface:Call
Executes the call until a successful result is returned or the configured policies are exceeded. -
cancel
public boolean cancel(boolean mayInterruptIfRunning) Description copied from interface:Call
Cancels a synchronous execution and calls the most recentcancelCallback
that was registered. The execution is still allowed to complete and return a result. In addition to using acancelCallback
, executions can cooperate with cancellation by checkingExecutionContext.isCancelled()
. -
isCancelled
public boolean isCancelled()Description copied from interface:Call
Returns whether the call has been cancelled.- Specified by:
isCancelled
in interfaceCall<R>
-