- Type Parameters:
T- the type of the return value (may be
- All Implemented Interfaces:
public abstract class SynchronousStepExecution<T> extends StepExecution
StepExecutionthat always executes synchronously. This API should be used for short-lived tasks that return almost instantly. To call legacy Jenkins APIs which are potentially long-running and interruptible yet offer no asynchronous mode (for example because they block on a remoting call) use
SynchronousNonBlockingStepExecution. Also note that long-lived tasks which do not need to run within a Java method call should use the more general
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description
protected abstract T
run()Meat of the execution.
start()Start execution of something and report the end result back to the given callback.
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, blocksRestart, getContext, getStatus, getStatusBounded, onResume
protected SynchronousStepExecution(@NonNull StepContext context)
runMeat of the execution. When this method returns, a step execution is over.
public final boolean start() throws ExceptionDescription copied from class:
StepExecutionStart execution of something and report the end result back to the given callback.
Arguments are passed when instantiating steps.
- Specified by:
- true if the execution of this step has synchronously completed before this method returns.
It is the callee's responsibility to set the return value via
FutureCallback.onFailure(Throwable). false if the asynchronous execution has started and that
StepContextwill be notified when the result comes in. (Note that the nature of asynchrony is such that it is possible for the
StepContextto be already notified before this method returns.)
Exception- if any exception is thrown,
Stepis assumed to have completed abnormally synchronously (as if
FutureCallback.onFailure(java.lang.Throwable)is called and the method returned true.)
stopIf the computation is going synchronously, try to cancel that.