Class BodyExecution
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.steps.BodyExecution
-
- All Implemented Interfaces:
Serializable
,Future<Object>
public abstract class BodyExecution extends Object implements Future<Object>, Serializable
Represents the executing body block ofStep
.As a representation of asynchronous computation, this object implements
Future
, so that you can cancel the execution, install a listener, etc.- Author:
- Kohsuke Kawaguchi
- See Also:
BodyInvoker.start()
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BodyExecution()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
cancel(boolean b)
Deprecated.usecancel(Throwable)
to provide richer contextboolean
cancel(Throwable t)
Attempts to cancel an executing body block.boolean
cancel(CauseOfInterruption... causes)
Deprecated.abstract Collection<StepExecution>
getCurrentExecutions()
Returns the inner-mostStepExecution
s that are currently executing.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.Future
get, get, isCancelled, isDone
-
-
-
-
Method Detail
-
getCurrentExecutions
public abstract Collection<StepExecution> getCurrentExecutions()
Returns the inner-mostStepExecution
s that are currently executing.
-
cancel
@Deprecated public boolean cancel(CauseOfInterruption... causes)
Deprecated.
-
cancel
@Deprecated public boolean cancel(boolean b)
Deprecated.usecancel(Throwable)
to provide richer context
-
cancel
public boolean cancel(Throwable t)
Attempts to cancel an executing body block.If the body has finished executing, or is cancelled already, the attempt will fail. This method is asynchronous. There's no guarantee that the cancellation has happened or completed before this method returns.
- Parameters:
t
- reason for cancellation; typically aFlowInterruptedException
- Returns:
- false if the task cannot be cancelled.
-
-