Class LockStepExecution
java.lang.Object
org.jenkinsci.plugins.workflow.steps.StepExecution
org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
org.jenkins.plugins.lockableresources.LockStepExecution
- All Implemented Interfaces:
Serializable,RemoteLockSession.Host
public class LockStepExecution
extends org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
implements RemoteLockSession.Host
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLockStepExecution(LockStep step, org.jenkinsci.plugins.workflow.steps.StepContext context) -
Method Summary
Modifier and TypeMethodDescriptionbuildLockEnvVars(String variable, LinkedHashMap<String, List<LockableResourceProperty>> lockedResources) Builds thelockEnvVarsmap injected for the duration of alock()block, following local semantics exactly:variable="X"with locked resourcesr1, r2yieldsX="r1,r2",X0="r1",X0_<prop>=<value>,X1="r2", ...org.jenkinsci.plugins.workflow.steps.StepContextcontext()The workflow step context (forRun/FlowNode/TaskListener, onSuccess/onFailure).voidonResume()static voidproceed(LinkedHashMap<String, List<LockableResourceProperty>> lockedResources, org.jenkinsci.plugins.workflow.steps.StepContext context, String resourceDescription, String variable) voidRuns the lock body; on completion the framework releases the remote lock viaRemoteLockSession.onBodyFinished(Host).booleanstart()step()The originatinglock()step.voidMethods inherited from class org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
injectMethods inherited from class org.jenkinsci.plugins.workflow.steps.StepExecution
acceptAll, acceptAll, applyAll, applyAll, blocksRestart, getContext, getStatus, getStatusBounded
-
Constructor Details
-
LockStepExecution
-
-
Method Details
-
start
- Specified by:
startin classorg.jenkinsci.plugins.workflow.steps.StepExecution- Throws:
Exception
-
context
public org.jenkinsci.plugins.workflow.steps.StepContext context()Description copied from interface:RemoteLockSession.HostThe workflow step context (forRun/FlowNode/TaskListener, onSuccess/onFailure).- Specified by:
contextin interfaceRemoteLockSession.Host
-
step
Description copied from interface:RemoteLockSession.HostThe originatinglock()step.- Specified by:
stepin interfaceRemoteLockSession.Host
-
runBody
public void runBody(String displayTarget, @CheckForNull Map<String, String> lockEnvVars, String lockId) Description copied from interface:RemoteLockSession.HostRuns the lock body; on completion the framework releases the remote lock viaRemoteLockSession.onBodyFinished(Host).- Specified by:
runBodyin interfaceRemoteLockSession.Host
-
proceed
public static void proceed(LinkedHashMap<String, List<LockableResourceProperty>> lockedResources, org.jenkinsci.plugins.workflow.steps.StepContext context, String resourceDescription, String variable) -
buildLockEnvVars
@CheckForNull public static Map<String,String> buildLockEnvVars(@CheckForNull String variable, @NonNull LinkedHashMap<String, List<LockableResourceProperty>> lockedResources) Builds thelockEnvVarsmap injected for the duration of alock()block, following local semantics exactly:variable="X"with locked resourcesr1, r2yieldsX="r1,r2",X0="r1",X0_<prop>=<value>,X1="r2", ... Property env vars are included. Returnsnullwhenvariableis null/empty.Shared by the local flow (
proceed(java.util.LinkedHashMap<java.lang.String, java.util.List<org.jenkins.plugins.lockableresources.LockableResourceProperty>>, org.jenkinsci.plugins.workflow.steps.StepContext, java.lang.String, java.lang.String)) and the remote bridge so the two never drift. All inputs (resource names and property name/value strings) are serializable, so the remote server can generate the same map and bridge it to the client. -
stop
- Overrides:
stopin classorg.jenkinsci.plugins.workflow.steps.StepExecution
-
onResume
public void onResume()- Overrides:
onResumein classorg.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl
-