Class CpsThread
java.lang.Object
org.jenkinsci.plugins.workflow.cps.CpsThread
- All Implemented Interfaces:
Serializable
Represents a
Continuable that is either runnable or suspended (that waits for an
external event.)- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intUnique ID of this thread among all the threads in the past or future under the sameCpsThreadGroup. -
Method Summary
Modifier and TypeMethodDescriptionstatic CpsThreadcurrent()WhileCpsThreadGroupexecutes, this method returnsCpsThreadthat's running.org.jenkinsci.plugins.workflow.cps.ContextVariableSetgetGroup()org.jenkinsci.plugins.workflow.steps.StepExecutiongetStep()Schedules the execution of this thread from the last Continuable.suspend(Object) point.voidStops the execution of this thread.toString()
-
Field Details
-
id
public final int idUnique ID of this thread among all the threads in the past or future under the sameCpsThreadGroup. This acts as a persistable handle forCpsStepContextto refer back to the thread, because they are persisted separately.
-
-
Method Details
-
getGroup
-
getExecution
-
getContextVariables
@CheckForNull public org.jenkinsci.plugins.workflow.cps.ContextVariableSet getContextVariables() -
getStep
public org.jenkinsci.plugins.workflow.steps.StepExecution getStep() -
resume
Schedules the execution of this thread from the last Continuable.suspend(Object) point.- Returns:
- Future that promises the completion of the next
runNextChunk().
-
stop
Stops the execution of this thread. If it's paused to wait for the completion ofStepExecution, callStepExecution.stop(Throwable)to give it a chance to clean up.If the execution is not inside a step (meaning it's paused in a safe point), then have the CPS thread throw a given
Throwableto break asap. -
getStackTrace
-
current
WhileCpsThreadGroupexecutes, this method returnsCpsThreadthat's running. -
toString
-