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
ModifierConstructorDescriptionprotected
TryRepeatedly
(int delay) protected
TryRepeatedly
(int delay, int initialDelay) -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancel
(boolean mayInterruptIfRunning) protected org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
getOwner()
Override to supply the owner passed toPickle.rehydrate(FlowExecutionOwner)
.protected void
printWaitingMessage
(TaskListener listener) AssuminggetOwner()
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
-
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 toPickle.rehydrate(FlowExecutionOwner)
. -
printWaitingMessage
AssuminggetOwner()
has been overridden, override to print a message to the build log explaining why the pickle is still unloadable. Could useModelHyperlinkNote
etc. -
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
tryResolve
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.
-