public final class CpsThread extends Object implements Serializable
Continuable
that is either runnable or suspended (that waits for an
external event.)Modifier and Type | Field and Description |
---|---|
int |
id
Unique ID of this thread among all the threads in the past or future under the same
CpsThreadGroup . |
Modifier and Type | Method and Description |
---|---|
static CpsThread |
current()
While
CpsThreadGroup executes, this method returns CpsThread
that's running. |
org.jenkinsci.plugins.workflow.cps.ContextVariableSet |
getContextVariables() |
CpsFlowExecution |
getExecution() |
CpsThreadGroup |
getGroup() |
List<StackTraceElement> |
getStackTrace() |
org.jenkinsci.plugins.workflow.steps.StepExecution |
getStep() |
Future<Object> |
resume(com.cloudbees.groovy.cps.Outcome v)
Schedules the execution of this thread from the last Continuable.suspend(Object) point.
|
void |
stop(Throwable t)
Stops the execution of this thread.
|
String |
toString() |
public final int id
CpsThreadGroup
.
This acts as a persistable handle for CpsStepContext
to
refer back to the thread,
because they are persisted separately.public CpsThreadGroup getGroup()
public CpsFlowExecution getExecution()
public org.jenkinsci.plugins.workflow.cps.ContextVariableSet getContextVariables()
public org.jenkinsci.plugins.workflow.steps.StepExecution getStep()
public Future<Object> resume(com.cloudbees.groovy.cps.Outcome v)
runNextChunk()
.public void stop(Throwable t)
StepExecution
,
call StepExecution.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.
public List<StackTraceElement> getStackTrace()
public static CpsThread current()
CpsThreadGroup
executes, this method returns CpsThread
that's running.Copyright © 2016–2020. All rights reserved.