- All Implemented Interfaces:
public abstract class GeneralNonBlockingStepExecution extends StepExecutionGeneralization of
SynchronousNonBlockingStepExecutionthat can be used for block-scoped steps. The step may at any given time either be running CPS VM code, running background code, or waiting for events (for example running a block).
- See Also:
- Serialized Form
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
blocksRestart()Allows a step to indicate that
AsynchronousExecution.blocksRestart()should be true.
getStatus()May be overridden to provide specific information about what a step is currently doing, for diagnostic purposes.
StepExecutionis brought back into memory after restart.
run(GeneralNonBlockingStepExecution.Block block)Initiate background work that should not block the CPS VM thread.
stop(Throwable cause)If the computation is going synchronously, try to cancel that.
Methods inherited from class org.jenkinsci.plugins.workflow.steps.StepExecution
applyAll, applyAll, getContext, getStatusBounded, start
protected GeneralNonBlockingStepExecution(StepContext context)
protected final void run(GeneralNonBlockingStepExecution.Block block)Initiate background work that should not block the CPS VM thread. Call this from a CPS VM thread, such as from
BodyExecutionCallback.onSuccess(org.jenkinsci.plugins.workflow.steps.StepContext, java.lang.Object). The block may finish by calling
block- some code to run in a utility thread
stopIf the computation is going synchronously, try to cancel that.
public void onResume()Called when
StepExecutionis brought back into memory after restart. Convenient for re-establishing the polling.
Currently not permitted to throw exceptions, but may report errors via
@NonNull public String getStatus()May be overridden to provide specific information about what a step is currently doing, for diagnostic purposes. Typical format should be a short, lowercase phrase. It should not be localized as this is intended for use by developers as well as users. May include technical details about Jenkins internals if relevant.
- current status, or null if unimplemented
- See Also:
public boolean blocksRestart()Allows a step to indicate that
AsynchronousExecution.blocksRestart()should be true. Typically this would be true if
StepExecution.getStatus()indicates that the step is in the middle of something active, as opposed to waiting for an external event or a body to complete.
Note that activity in the CPS VM thread automatically blocks restart, so overriding this is only necessary for steps using a background thread, such as