Class AbstractSynchronousStepExecution<T>
java.lang.Object
org.jenkinsci.plugins.workflow.steps.StepExecution
org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution<T>
- Type Parameters:
T
- the type of the return value (may beVoid
)
- All Implemented Interfaces:
Serializable
@Deprecated
public abstract class AbstractSynchronousStepExecution<T>
extends AbstractStepExecutionImpl
Deprecated.
StepExecution
that 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 AbstractSynchronousNonBlockingStepExecution
.
Also note that long-lived tasks which do not need to run within a Java method call should use the more general AbstractStepExecutionImpl
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.protected
Deprecated. -
Method Summary
Methods inherited from class org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
inject, onResume
Methods inherited from class org.jenkinsci.plugins.workflow.steps.StepExecution
applyAll, applyAll, blocksRestart, getContext, getStatus, getStatusBounded
-
Constructor Details
-
AbstractSynchronousStepExecution
protected AbstractSynchronousStepExecution()Deprecated. -
AbstractSynchronousStepExecution
Deprecated.
-
-
Method Details
-
run
Deprecated.Meat of the execution. When this method returns, a step execution is over.- Throws:
Exception
-
start
Deprecated.Description copied from class:StepExecution
Start execution of something and report the end result back to the given callback.Arguments are passed when instantiating steps.
This method will run in the CPS VM thread and as such should not perform I/O or block. Use
SynchronousNonBlockingStepExecution
orGeneralNonBlockingStepExecution
as needed.- Specified by:
start
in classStepExecution
- Returns:
- 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
StepContext.onSuccess(Object)
orFutureCallback.onFailure(Throwable)
. false if the asynchronous execution has started and thatStepContext
will be notified when the result comes in. (Note that the nature of asynchrony is such that it is possible for theStepContext
to be already notified before this method returns.) - Throws:
Exception
- if any exception is thrown,Step
is assumed to have completed abnormally synchronously (as ifFutureCallback.onFailure(java.lang.Throwable)
is called and the method returned true.)
-
stop
Deprecated.If the computation is going synchronously, try to cancel that.- Overrides:
stop
in classStepExecution
- Parameters:
cause
- Contextual information that lets the step know what resulted in stopping an executing step, passed in the hope that this will assist diagnostics.- Throws:
Exception
-
SynchronousStepExecution
and avoid Guice.