Class ManagedJobContext
java.lang.Object
org.j7m.middleware.application.distributed.ManagedJobContext
Actual current job claim capability, supplied only through an explicit provider host binding.
Checkpoint/progress are explicit safe points on the current POJO. Protected effects are staged
and commit atomically with native completion; arbitrary external I/O is not made exactly once.
Retaining this object never retargets its run, owner, fence or pinned partition epoch.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanObserves cancellation or revocation without acquiring or renewing authority.voidCalls actual checkpoint/progress hooks and durably saves their bounded data envelope.longfence()Returns this claim's native fence, never a general database lock token.jobId()Returns the original stable logical occurrence identity.longReturns the immutable route epoch captured before this claim.voidprogress()Calls only the explicit progress hook, retaining the last durable checkpoint unchanged.org.j7m.middleware.distributed.ReplicatedResources.ValueReads the exact same native protected map used by this claim's final staged effects.voidstageEffect(String key, long expectedVersion, String value) Stages a protected compare-and-set, without performing an immediate write.toString()Omits identity, fence and application data from diagnostics.
-
Method Details
-
jobId
Returns the original stable logical occurrence identity.- Returns:
- current job identity
- Throws:
org.j7m.middleware.api.MiddlewareException- outside this live owned USER invocation
-
fence
public long fence()Returns this claim's native fence, never a general database lock token.- Returns:
- captured live ownership fence
- Throws:
org.j7m.middleware.api.MiddlewareException- outside this live owned USER invocation
-
partitionEpoch
public long partitionEpoch()Returns the immutable route epoch captured before this claim.- Returns:
- pinned partition epoch
- Throws:
org.j7m.middleware.api.MiddlewareException- outside this live owned USER invocation
-
cancellationRequested
public boolean cancellationRequested()Observes cancellation or revocation without acquiring or renewing authority.- Returns:
- whether work should cooperatively stop
-
checkpoint
public void checkpoint()Calls actual checkpoint/progress hooks and durably saves their bounded data envelope.- Throws:
org.j7m.middleware.api.MiddlewareException- after revocation, uncertain native completion or original deadlineIllegalArgumentException- if no checkpoint pair is declared or its frame exceeds bounds
-
progress
public void progress()Calls only the explicit progress hook, retaining the last durable checkpoint unchanged.- Throws:
org.j7m.middleware.api.MiddlewareException- after revocation or uncertain native completionIllegalArgumentException- if no progress hook is declared or its frame exceeds bounds
-
read
Reads the exact same native protected map used by this claim's final staged effects.- Parameters:
key- logical identifier,1..128 characters- Returns:
- immutable value/version, or null when absent
- Throws:
org.j7m.middleware.api.MiddlewareException- after revocation, unavailable quorum or original deadline
-
stageEffect
Stages a protected compare-and-set, without performing an immediate write. Up to64 distinct keys and64KiB encoded key/value data fit one native completion command.- Parameters:
key- logical identifier,1..128 charactersexpectedVersion- exact current version, zero for absencevalue- textual data, at most4096 UTF16 code units without NUL- Throws:
org.j7m.middleware.api.MiddlewareException- outside the original live USER invocationIllegalArgumentException- for malformed input, duplicates or capacity
-
toString
-