T
- the type of the return value (may be Void
)SynchronousStepExecution
and avoid Guice.@Deprecated public abstract class AbstractSynchronousStepExecution<T> extends AbstractStepExecutionImpl
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
Modifier | Constructor and Description |
---|---|
protected |
AbstractSynchronousStepExecution()
Deprecated.
|
protected |
AbstractSynchronousStepExecution(StepContext context)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
run()
Deprecated.
Meat of the execution.
|
boolean |
start()
Deprecated.
Start execution of something and report the end result back to the given callback.
|
void |
stop(Throwable cause)
Deprecated.
If the computation is going synchronously, try to cancel that.
|
inject, onResume
applyAll, applyAll, getContext, getStatus, getStatusBounded, toString
protected AbstractSynchronousStepExecution()
protected AbstractSynchronousStepExecution(StepContext context)
protected abstract T run() throws Exception
Exception
public final boolean start() throws Exception
StepExecution
start
in class StepExecution
StepContext.onSuccess(Object)
or FutureCallback.onFailure(Throwable)
.
false if the asynchronous execution has started and that StepContext
will be notified when the result comes in. (Note that the nature of asynchrony is such that it is possible
for the StepContext
to be already notified before this method returns.)Exception
- if any exception is thrown, Step
is assumed to have completed abnormally synchronously
(as if FutureCallback.onFailure(java.lang.Throwable)
is called and the method returned true.)public void stop(Throwable cause) throws Exception
stop
in class StepExecution
cause
- Contextual information that lets the step know what resulted in stopping an executing step,
passed in the hope that this will assist diagnostics.Exception
Copyright © 2016–2017. All rights reserved.