Interface ExecutionInternal<R>

Type Parameters:
R - result type
All Superinterfaces:
ExecutionContext<R>
All Known Subinterfaces:
AsyncExecutionInternal<R>, SyncExecutionInternal<R>
All Known Implementing Classes:
AsyncExecutionImpl, ExecutionImpl, SyncExecutionImpl

public interface ExecutionInternal<R> extends ExecutionContext<R>
Internal execution APIs.
  • Method Details

    • getResult

      ExecutionResult<R> getResult()
      Returns the recorded result for an execution attempt.
    • preExecute

      void preExecute()
      Called when execution of the user's supplier is about to begin.
    • isPreExecuted

      boolean isPreExecuted()
      Returns whether the execution has been pre-executed, indicating the attempt has started.
    • recordAttempt

      void recordAttempt()
      Records an execution attempt which may correspond with an execution result. Async executions will have results recorded separately.
    • record

      void record(ExecutionResult<R> result)
      Records the result if the execution has been pre-executed and a result has not already been recorded.
    • cancel

      boolean cancel()
      Marks the execution as having been cancelled externally, which will cancel pending executions of all policies.
      Returns:
      whether cancellation was successful or not. Returns false if the execution was already cancelled or completed.
    • cancel

      void cancel(PolicyExecutor<R> policyExecutor)
      Marks the execution as having been cancelled by the policyExecutor, which will also cancel pending executions of any inner policies of the policyExecutor. Outer policies of the policyExecutor will be unaffected.
    • isCancelled

      boolean isCancelled(PolicyExecutor<R> policyExecutor)
      Returns whether the execution is considered cancelled for the policyExecutor.
    • getLock

      Object getLock()
      Returns a lock object that is common across all execution attempts. Useful for guarding against races when mutating an execution.
    • getLatest

      ExecutionInternal<R> getLatest()
      Returns the most recent execution to be attempted.