Class FlowExecutionList
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.flow.FlowExecutionList
-
- All Implemented Interfaces:
Iterable<FlowExecution>
@Extension public class FlowExecutionList extends Object implements Iterable<FlowExecution>
Tracks the runningFlowExecution
s so that it can be enumerated.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlowExecutionList.ItemListenerImpl
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
FlowExecutionList.ResumeStepExecutionListener
Whenever a Pipeline resumes, resume all incomplete steps in itsFlowExecution
.static class
FlowExecutionList.StepExecutionIteratorImpl
EnumeratesStepExecution
s running insideFlowExecution
.
-
Field Summary
Fields Modifier and Type Field Description static String
EXECUTIONS_SUSPENDED
static String
LIST_SAVED
-
Constructor Summary
Constructors Constructor Description FlowExecutionList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FlowExecutionList
get()
boolean
isResumptionComplete()
Returns true if all executions that were present in thisFlowExecutionList
have been loaded.Iterator<FlowExecution>
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 Detail
-
EXECUTIONS_SUSPENDED
public static final String EXECUTIONS_SUSPENDED
Milestone forTerminator
betweenTermMilestone.STARTED
andLIST_SAVED
. All running builds have been suspended and theirFlowExecutionOwner.getListener()
s closed.- See Also:
- Constant Field Values
-
LIST_SAVED
public static final String LIST_SAVED
Milestone forTerminator
betweenEXECUTIONS_SUSPENDED
andTermMilestone.COMPLETED
.FlowExecutionList
itself has been saved.- See Also:
- Constant Field Values
-
-
Method Detail
-
iterator
public Iterator<FlowExecution> iterator()
Lists all the currentFlowExecutionOwner
s.- Specified by:
iterator
in interfaceIterable<FlowExecution>
-
register
public void register(FlowExecutionOwner self)
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
public void unregister(FlowExecutionOwner self)
-
get
public static FlowExecutionList 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
-
-