Class SynchronousNonBlockingStepExecution<T>
java.lang.Object
org.jenkinsci.plugins.workflow.steps.StepExecution
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution<T>
- Type Parameters:
 T- the type of the return value (may beVoid)
- All Implemented Interfaces:
 Serializable
Similar to 
SynchronousStepExecution (it executes synchronously too) but it does not block the CPS VM thread.- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleanAllows a step to indicate thatAsynchronousExecution.blocksRestart()should be true.May be overridden to provide specific information about what a step is currently doing, for diagnostic purposes.voidonResume()Called whenStepExecutionis brought back into memory after restart.protected abstract Trun()Meat of the execution.final booleanstart()Start execution of something and report the end result back to the given callback.voidIf the computation is going synchronously, try to cancel that.Methods inherited from class org.jenkinsci.plugins.workflow.steps.StepExecution
acceptAll, acceptAll, applyAll, applyAll, getContext, getStatusBounded 
- 
Constructor Details
- 
SynchronousNonBlockingStepExecution
 
 - 
 - 
Method Details
- 
run
Meat of the execution. When this method returns, a step execution is over.- Throws:
 Exception
 - 
start
Description copied from class:StepExecutionStart 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
SynchronousNonBlockingStepExecutionorGeneralNonBlockingStepExecutionas needed.- Specified by:
 startin 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 thatStepContextwill be notified when the result comes in. (Note that the nature of asynchrony is such that it is possible for theStepContextto be already notified before this method returns.) - Throws:
 Exception- if any exception is thrown,Stepis assumed to have completed abnormally synchronously (as ifFutureCallback.onFailure(java.lang.Throwable)is called and the method returned true.)
 - 
stop
If the computation is going synchronously, try to cancel that.- Overrides:
 stopin 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
 - 
onResume
public void onResume()Description copied from class:StepExecutionCalled whenStepExecutionis brought back into memory after restart. Convenient for re-establishing the polling.Currently not permitted to throw exceptions, but may report errors via
FutureCallback.onFailure(java.lang.Throwable).- Overrides:
 onResumein classStepExecution- See Also:
 
 - 
getStatus
Description copied from class:StepExecutionMay 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.- Overrides:
 getStatusin classStepExecution- Returns:
 - current status, or null if unimplemented
 - See Also:
 
 - 
blocksRestart
public boolean blocksRestart()Description copied from class:StepExecutionAllows a step to indicate thatAsynchronousExecution.blocksRestart()should be true. Typically this would be true ifStepExecution.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
SynchronousNonBlockingStepExecutionorGeneralNonBlockingStepExecution.- Overrides:
 blocksRestartin classStepExecution- Returns:
 - false by default
 
 
 -