Class JobLifecycleService
java.lang.Object
com.bluebell.greenhouse.radicle.services.job.JobLifecycleService
Performs short, fenced lifecycle transactions around durable action execution.
- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSignals cooperative cancellation to the worker loop.static final classSignals that a worker lost ownership and must stop writing lifecycle state. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCompletes cooperative cancellation at a safe checkpoint.voidcompleteAction(JobClaim claim, String executionId, ActionData actionData) Completes an action after confirming that the worker still owns the job.voidcompleteJob(JobClaim claim) Completes a successfully executed attempt.voidfailAction(JobClaim claim, String executionId, String failureKind, String failureCode, String message, Throwable throwable) Records a structured action failure and skips later action plan items.orderedActionIds(JobClaim claim) Returns ordered action identifiers after validating current worker ownership.startAction(JobClaim claim, Long actionId) Starts an action after confirming that the worker still owns the job.
-
Constructor Details
-
JobLifecycleService
public JobLifecycleService()
-
-
Method Details
-
startAction
Starts an action after confirming that the worker still owns the job.- Parameters:
claim- current claimactionId- action database identifier- Returns:
- created execution
-
completeAction
@Transactional public void completeAction(JobClaim claim, String executionId, ActionData actionData) Completes an action after confirming that the worker still owns the job.- Parameters:
claim- current claimexecutionId- public execution identifieractionData- handler result
-
failAction
@Transactional public void failAction(JobClaim claim, String executionId, String failureKind, String failureCode, String message, Throwable throwable) Records a structured action failure and skips later action plan items.- Parameters:
claim- current claimexecutionId- public execution identifierfailureKind- failure categoryfailureCode- stable failure codemessage- operator-safe messagethrowable- optional diagnostic cause
-
completeJob
Completes a successfully executed attempt.- Parameters:
claim- current claim
-
cancelJob
Completes cooperative cancellation at a safe checkpoint.- Parameters:
claim- current claim
-
orderedActionIds
-