Class JobDefinitionRegistry
java.lang.Object
com.bluebell.greenhouse.radicle.services.job.JobDefinitionRegistry
Registry of executable job definitions. Enum-only historical types intentionally have no
definition.
- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
ConstructorsConstructorDescriptionCreates the active definition registry and registers every currently executable job type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the job type is currently executable.booleanisRetryable(JobType jobType, String failureKind, int attemptNumber) Returns whether a failed attempt of this type may be retried again.minimumRerunInterval(JobType jobType) Returns the shortest gap permitted between two scheduled runs of a job type.<T extends JobPayload>
JobDefinition<T> resolve(JobDefinitionKey<T> key) Resolves and validates a typed definition.retryDelay(JobType jobType, int attemptNumber) Calculates the delay before the next automatic attempt, using the definition's own backoff, ceiling and jitter rather than a constant duplicated at each failure site.
-
Constructor Details
-
JobDefinitionRegistry
public JobDefinitionRegistry()Creates the active definition registry and registers every currently executable job type.
-
-
Method Details
-
resolve
Resolves and validates a typed definition.- Type Parameters:
T- payload type- Parameters:
key- typed definition key- Returns:
- registered definition
-
contains
Returns whether the job type is currently executable.- Parameters:
jobType- job type- Returns:
- true when registered
-
minimumRerunInterval
-
isRetryable
Returns whether a failed attempt of this type may be retried again. Attempt limits come from the definition rather than from the attempt row, so raising a limit applies to work already queued.- Parameters:
jobType- job typefailureKind- failure categoryattemptNumber- failed attempt number- Returns:
- true when another automatic attempt is permitted
-
retryDelay
Calculates the delay before the next automatic attempt, using the definition's own backoff, ceiling and jitter rather than a constant duplicated at each failure site.- Parameters:
jobType- job typeattemptNumber- failed attempt number- Returns:
- retry delay
-