Class DurableSchedules
java.lang.Object
org.j7m.middleware.application.distributed.DurableSchedules
- All Implemented Interfaces:
AutoCloseable
Durable one-occurrence trigger engine with no threads or idle polling. A known next due time
drives a host timer. Atomic CAS records pending before submission; only confirmed stable submit
advances the cursor. A crash between stores replays the same planned UTC identity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTrusted host-only submission bridge; must use a captured canonical input frame, stable request identity and original deadline.static final recordBounded engine observation for a host's next timer. -
Constructor Summary
ConstructorsConstructorDescriptionDurableSchedules(ManagedScheduleProfile profile, String definitionKey, String semanticFingerprint, boolean serial, DurableSchedules.Submitter submitter) Creates a trigger without starting I/O or application work. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops future engine operations without I/O or closing borrowed metadata/backend resources.voidRegisters or verifies the immutable definition and initial cursor using quorum CAS.Advances at most one confirmed planned occurrence.toString()Omits definition identity, input and capabilities.
-
Constructor Details
-
DurableSchedules
public DurableSchedules(ManagedScheduleProfile profile, String definitionKey, String semanticFingerprint, boolean serial, DurableSchedules.Submitter submitter) Creates a trigger without starting I/O or application work.- Parameters:
profile- trusted immutable settingsdefinitionKey- stable namespace/job/version identity, unchanged across artifact replacementssemanticFingerprint- canonical program and input fingerprint, SHA256 lowercase hexserial- whether the target job profile enforces native serial claimssubmitter- trusted captured-frame bridge to the managed job client- Throws:
NullPointerException- for missing collaboratorsIllegalArgumentException- for invalid identity, fingerprint or contradictory overlap
-
-
Method Details
-
prepare
Registers or verifies the immutable definition and initial cursor using quorum CAS.- Parameters:
deadline- original absolute I/O deadline- Throws:
IOException- on unavailable or ambiguous metadata operationsIllegalArgumentException- if a different definition already owns this identityIllegalStateException- after close or on unsupported native metadata responses
-
tick
Advances at most one confirmed planned occurrence. Pending work is always recovered before applying misfire policy; it is never discarded merely because the scheduler restarted late. Calls before cached next due perform no metadata RPC. Unsafe time fails before any mutation.- Parameters:
deadline- original absolute I/O and submit deadline, never refreshed inside the engine- Returns:
- known next timer and bounded status
- Throws:
IOException- for unsafe time, unavailable stores, contention or uncertain submissionIllegalArgumentException- for incompatible/corrupt persisted metadataIllegalStateException- before preparation, after close or for rejected submission
-
close
public void close()Stops future engine operations without I/O or closing borrowed metadata/backend resources.- Specified by:
closein interfaceAutoCloseable
-
toString
-