Class ManagedJobClient

java.lang.Object
org.j7m.middleware.application.distributed.ManagedJobClient
All Implemented Interfaces:
AutoCloseable

public final class ManagedJobClient extends Object implements AutoCloseable
Host-selected typed durable job producer and query facade, without worker credentials or claims. Its exact profile/namespace/program is selected by trusted setup, never by an application name lookup. Public status is authoritative native state; local cancellation is not physical completion.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.j7m.middleware.distributed.ExecutionResult
    cancel(String logical, Instant deadline)
    Durably cancels native work and fences its prior owner; this is not Java task termination.
    <T> T
    checkpoint(String logical, Class<T> type, Instant deadline)
    Reads the last confirmed checkpoint without observing live Java heap state.
    void
    Revokes this producer/query facade without closing borrowed endpoints or running workers.
    <T> T
    progress(String logical, Class<T> type, Instant deadline)
    Reads the last confirmed progress hook value bound to the run's durable version.
    org.j7m.middleware.distributed.ReplicatedResources.Value
    readProtected(String key, Instant deadline)
    Reads a protected value in the same fixed host namespace as job staged effects.
    <T> T
    result(String logical, Class<T> type, Instant deadline)
    Reads the declared typed terminal result; no app exception or stack is deserialized.
    org.j7m.middleware.distributed.ExecutionResult
    status(String logical, Instant deadline)
    Reads durable logical status and its monotonically increasing native run version.
    org.j7m.middleware.distributed.ExecutionResult
    submit(String logical, Object input, Instant deadline)
    Durably submits one stable logical occurrence with the first caller's trace carrier.
    Omits namespace, identities and input data.

    Methods inherited from class Object

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

    • submit

      public org.j7m.middleware.distributed.ExecutionResult submit(String logical, Object input, Instant deadline) throws IOException
      Durably submits one stable logical occurrence with the first caller's trace carrier.
      Parameters:
      logical - stable application occurrence identity, at most512 UTF16 code units
      input - data of the declared input type
      deadline - original submission deadline, not the background handler's execution budget
      Returns:
      READY, CONFLICT or explicit native capacity outcome
      Throws:
      IOException - if submission outcome is unavailable or UNKNOWN
      IllegalArgumentException - for malformed identity, input or bounded envelope
    • cancel

      public org.j7m.middleware.distributed.ExecutionResult cancel(String logical, Instant deadline) throws IOException
      Durably cancels native work and fences its prior owner; this is not Java task termination. The cooperative context observes revocation through native renewal/checkpoint fencing.
      Parameters:
      logical - stable occurrence identity
      deadline - original cancellation operation deadline
      Returns:
      CANCELLED or ALREADY_COMPLETED, never proof of physical handler exit
      Throws:
      IOException - if cancellation outcome is unavailable or UNKNOWN
    • status

      public org.j7m.middleware.distributed.ExecutionResult status(String logical, Instant deadline) throws IOException
      Reads durable logical status and its monotonically increasing native run version.
      Parameters:
      logical - stable occurrence identity
      deadline - original read deadline
      Returns:
      durable status; a committed failed outcome is FAILED, with authorized native metadata
      Throws:
      IOException - if the current quorum is unavailable
    • result

      public <T> T result(String logical, Class<T> type, Instant deadline) throws IOException
      Reads the declared typed terminal result; no app exception or stack is deserialized.
      Type Parameters:
      T - expected result type
      Parameters:
      logical - stable occurrence identity
      type - exact declared result type, primitive boxing allowed
      deadline - original read deadline
      Returns:
      persisted result, possibly null for a void entry
      Throws:
      IOException - if quorum is unavailable
      IllegalStateException - if not terminal or the durable logical outcome is failed
      IllegalArgumentException - for incompatible type or frame
    • checkpoint

      public <T> T checkpoint(String logical, Class<T> type, Instant deadline) throws IOException
      Reads the last confirmed checkpoint without observing live Java heap state.
      Type Parameters:
      T - checkpoint type
      Parameters:
      logical - stable occurrence identity
      type - exact declared checkpoint reference type
      deadline - original read deadline
      Returns:
      persisted state, or null before any checkpoint
      Throws:
      IOException - if quorum is unavailable
      IllegalArgumentException - for incompatible type or frame
    • progress

      public <T> T progress(String logical, Class<T> type, Instant deadline) throws IOException
      Reads the last confirmed progress hook value bound to the run's durable version.
      Type Parameters:
      T - progress type
      Parameters:
      logical - stable occurrence identity
      type - exact declared progress reference type
      deadline - original read deadline
      Returns:
      persisted progress, or null before any progress capture
      Throws:
      IOException - if quorum is unavailable
      IllegalArgumentException - for incompatible type or frame
    • readProtected

      public org.j7m.middleware.distributed.ReplicatedResources.Value readProtected(String key, Instant deadline) throws IOException
      Reads a protected value in the same fixed host namespace as job staged effects.
      Parameters:
      key - logical identifier,1..128 ASCII identifier characters
      deadline - original read deadline
      Returns:
      immutable native value/version, or null
      Throws:
      IOException - if quorum is unavailable
      IllegalArgumentException - for malformed key
    • close

      public void close()
      Revokes this producer/query facade without closing borrowed endpoints or running workers.
      Specified by:
      close in interface AutoCloseable
    • toString

      public String toString()
      Omits namespace, identities and input data.
      Overrides:
      toString in class Object
      Returns:
      fixed safe diagnostic