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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback
BodyExecutionCallback.TailCall
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.final 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
-
Constructor Details
-
TailCall
public TailCall()
-
-
Method Details
-
finished
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
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
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
-