Class FlowExecutionList
java.lang.Object
org.jenkinsci.plugins.workflow.flow.FlowExecutionList
- All Implemented Interfaces:
Iterable<FlowExecution>
Tracks the running
FlowExecution
s so that it can be enumerated.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
When Jenkins starts up and everything is loaded, be sure to proactively resurrect all the ongoingFlowExecution
s so that they start running again.static class
Whenever a Pipeline resumes, resume all incomplete steps in itsFlowExecution
.static class
EnumeratesStepExecution
s running insideFlowExecution
. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic FlowExecutionList
get()
boolean
Returns true if all executions that were present in thisFlowExecutionList
have been loaded.iterator()
Lists all the currentFlowExecutionOwner
s.void
register
(FlowExecutionOwner self) It is the responsibility of theFlowExecutionOwner
to register itself before it starts executing.static void
saveAll()
void
unregister
(FlowExecutionOwner self) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EXECUTIONS_SUSPENDED
Milestone forTerminator
betweenTermMilestone.STARTED
andLIST_SAVED
. All running builds have been suspended and theirFlowExecutionOwner.getListener()
s closed.- See Also:
-
LIST_SAVED
Milestone forTerminator
betweenEXECUTIONS_SUSPENDED
andTermMilestone.COMPLETED
.FlowExecutionList
itself has been saved.- See Also:
-
-
Constructor Details
-
FlowExecutionList
public FlowExecutionList()
-
-
Method Details
-
iterator
Lists all the currentFlowExecutionOwner
s.- Specified by:
iterator
in interfaceIterable<FlowExecution>
-
register
It is the responsibility of theFlowExecutionOwner
to register itself before it starts executing. And likewise, unregister itself after it is completed, even though this class does clean up entries that are no longer running. -
unregister
-
get
-
isResumptionComplete
@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public boolean isResumptionComplete()Returns true if all executions that were present in thisFlowExecutionList
have been loaded.This takes place slightly after
InitMilestone.COMPLETED
is reached during Jenkins startup.Useful to avoid resuming Pipelines in contexts that may lead to deadlock.
It is not guaranteed that
FlowExecution.afterStepExecutionsResumed()
has been called at this point. -
saveAll
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @Terminator(requires="FlowExecutionList.EXECUTIONS_SUSPENDED", attains="FlowExecutionList.LIST_SAVED") public static void saveAll() throws InterruptedException- Throws:
InterruptedException
-