Class ManagedJobContext

java.lang.Object
org.j7m.middleware.application.distributed.ManagedJobContext

public final class ManagedJobContext extends Object
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 Type
    Method
    Description
    boolean
    Observes cancellation or revocation without acquiring or renewing authority.
    void
    Calls actual checkpoint/progress hooks and durably saves their bounded data envelope.
    long
    Returns this claim's native fence, never a general database lock token.
    Returns the original stable logical occurrence identity.
    long
    Returns the immutable route epoch captured before this claim.
    void
    Calls only the explicit progress hook, retaining the last durable checkpoint unchanged.
    org.j7m.middleware.distributed.ReplicatedResources.Value
    read(String key)
    Reads the exact same native protected map used by this claim's final staged effects.
    void
    stageEffect(String key, long expectedVersion, String value)
    Stages a protected compare-and-set, without performing an immediate write.
    Omits identity, fence and application data from diagnostics.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • jobId

      public String 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 deadline
      IllegalArgumentException - 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 completion
      IllegalArgumentException - if no progress hook is declared or its frame exceeds bounds
    • read

      public org.j7m.middleware.distributed.ReplicatedResources.Value read(String key)
      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

      public void stageEffect(String key, long expectedVersion, String value)
      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 characters
      expectedVersion - exact current version, zero for absence
      value - textual data, at most4096 UTF16 code units without NUL
      Throws:
      org.j7m.middleware.api.MiddlewareException - outside the original live USER invocation
      IllegalArgumentException - for malformed input, duplicates or capacity
    • toString

      public String toString()
      Omits identity, fence and application data from diagnostics.
      Overrides:
      toString in class Object
      Returns:
      fixed revocation diagnostic