Class BodyExecutionCallback.TailCall
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback
-
- org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback.TailCall
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- BodyExecutionCallback
public abstract static class BodyExecutionCallback.TailCall extends BodyExecutionCallback
A convenience subclass for the common case that the step expects to run its block just once and return the same value (or throw the same error).- See Also:
- Tail call, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback
BodyExecutionCallback.TailCall
-
-
Constructor Summary
Constructors Constructor Description TailCall()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
finished(StepContext context)
Called when the body is finished.void
onFailure(StepContext context, Throwable t)
Notifies that the body execution has aborted abnormally.void
onSuccess(StepContext context, Object result)
Notifies that the body execution has completed successfully.-
Methods inherited from class org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback
onStart, wrap
-
-
-
-
Method Detail
-
finished
protected abstract void finished(StepContext context) throws Exception
Called when the body is finished.This method will run in the CPS VM thread and as such should not perform I/O or block. Use
GeneralNonBlockingStepExecution.TailCall
as needed.- Parameters:
context
- the body context as passed toonSuccess(org.jenkinsci.plugins.workflow.steps.StepContext, java.lang.Object)
oronFailure(org.jenkinsci.plugins.workflow.steps.StepContext, java.lang.Throwable)
- Throws:
Exception
- if anything is thrown here, the step fails too
-
onSuccess
public final void onSuccess(StepContext context, Object result)
Description copied from class:BodyExecutionCallback
Notifies that the body execution has completed successfully.StepContext
given to this method lets you access objects that correspond to the end of the body, as opposed to the objects that correspond to the invocation of the step that invoked the body. Otherwise the context is identical in behaviour to that given toStep.start(StepContext)
.So for example this is a good place to record any logging that's attributed to the end of the body execution.
- Specified by:
onSuccess
in classBodyExecutionCallback
-
onFailure
public void onFailure(StepContext context, Throwable t)
Description copied from class:BodyExecutionCallback
Notifies that the body execution has aborted abnormally.See
BodyExecutionCallback.onSuccess(StepContext, Object)
for the discussion of how the givenStepContext
behaves.- Specified by:
onFailure
in classBodyExecutionCallback
-
-