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
Modifier and TypeFieldDescriptionfinal int
Unique ID of this thread among all the threads in the past or future under the sameCpsThreadGroup
. -
Method Summary
Modifier and TypeMethodDescriptionstatic CpsThread
current()
WhileCpsThreadGroup
executes, this method returnsCpsThread
that's running.org.jenkinsci.plugins.workflow.cps.ContextVariableSet
getGroup()
org.jenkinsci.plugins.workflow.steps.StepExecution
getStep()
Schedules the execution of this thread from the last Continuable.suspend(Object) point.void
Stops 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 forCpsStepContext
to refer back to the thread, because they are persisted separately.
-
-
Method Details
-
getGroup
-
getExecution
-
getContextVariables
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
Throwable
to break asap. -
getStackTrace
-
current
WhileCpsThreadGroup
executes, this method returnsCpsThread
that's running. -
toString
-