Class TryRepeatedly<V>

java.lang.Object
com.google.common.util.concurrent.internal.InternalFutureFailureAccess
com.google.common.util.concurrent.AbstractFuture<V>
org.jenkinsci.plugins.workflow.support.pickles.TryRepeatedly<V>
All Implemented Interfaces:
com.google.common.util.concurrent.ListenableFuture<V>, Future<V>

public abstract class TryRepeatedly<V> extends com.google.common.util.concurrent.AbstractFuture<V>
ListenableFuture that promises a value that needs to be periodically tried. Specialized for use from Pickle.rehydrate(FlowExecutionOwner).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TryRepeatedly(int delay)
     
    protected
    TryRepeatedly(int delay, int initialDelay)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    cancel(boolean mayInterruptIfRunning)
     
    protected org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
    Override to supply the owner passed to Pickle.rehydrate(FlowExecutionOwner).
    protected void
    Assuming getOwner() has been overridden, override to print a message to the build log explaining why the pickle is still unloadable.
    protected abstract V
    This method is called periodically to attempt to resolve the value that this future promises.

    Methods inherited from class com.google.common.util.concurrent.AbstractFuture

    addListener, afterDone, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TryRepeatedly

      protected TryRepeatedly(int delay)
    • TryRepeatedly

      protected TryRepeatedly(int delay, int initialDelay)
  • Method Details

    • getOwner

      @NonNull protected org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner getOwner()
      Override to supply the owner passed to Pickle.rehydrate(FlowExecutionOwner).
    • printWaitingMessage

      protected void printWaitingMessage(@NonNull TaskListener listener)
      Assuming getOwner() has been overridden, override to print a message to the build log explaining why the pickle is still unloadable. Could use ModelHyperlinkNote etc.
    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      Specified by:
      cancel in interface Future<V>
      Overrides:
      cancel in class com.google.common.util.concurrent.AbstractFuture<V>
    • tryResolve

      @CheckForNull protected abstract V tryResolve() throws Exception
      This method is called periodically to attempt to resolve the value that this future promises.
      Returns:
      null to retry this at a later moment.
      Throws:
      Exception - Any exception thrown will cause the future to fail.