Package dev.failsafe

Class CallImpl<R>

java.lang.Object
dev.failsafe.CallImpl<R>
Type Parameters:
R - result type
All Implemented Interfaces:
Call<R>

class CallImpl<R> extends Object implements Call<R>
A call implementation that delegates to an execution.
  • Field Details

  • Constructor Details

    • CallImpl

      CallImpl()
  • Method Details

    • setExecution

      void setExecution(SyncExecutionImpl<R> execution)
    • execute

      public R execute()
      Description copied from interface: Call
      Executes the call until a successful result is returned or the configured policies are exceeded.
      Specified by:
      execute in interface Call<R>
    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      Description copied from interface: Call
      Cancels a synchronous execution and calls the most recent cancelCallback that was registered. The execution is still allowed to complete and return a result. In addition to using a cancelCallback, executions can cooperate with cancellation by checking ExecutionContext.isCancelled().
      Specified by:
      cancel in interface Call<R>
      Parameters:
      mayInterruptIfRunning - whether the execution should be interrupted
      Returns:
      whether cancellation was successful or not. Returns false if the execution was already cancelled or completed.
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Call
      Returns whether the call has been cancelled.
      Specified by:
      isCancelled in interface Call<R>