Class ApplicationManagerHost

java.lang.Object
org.j7m.middleware.cluster.ApplicationManagerHost
All Implemented Interfaces:
HostingSupervisor, ManagedInvocation

public final class ApplicationManagerHost extends Object implements HostingSupervisor
Actual ApplicationManager hosting adapter with revision-pinned admission and counted in-flight calls. ArtifactRepositoryClient verifies signed D14 metadata and every byte before repository publication; the application manager also enforces its configured bundle verification policy. Managed readiness and canary admission consume fresh application probe observations; missing, failed or expired managed observations hold traffic. Legacy readiness remains RUNNING-based. Inspection never waits for application probe code while holding this host's monitor. This adapter upgrades hosted applications, not the middleware executable.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Server-configured service binding; remote callers supply its alias only.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApplicationManagerHost(String nodeId, org.j7m.middleware.api.MiddlewareRuntime runtime, org.j7m.middleware.deployer.ApplicationManager manager, org.j7m.middleware.application.repository.LocalApplicationRepository repository, org.j7m.middleware.application.repository.ArtifactRepositoryClient artifacts, Path staging, Map<String, ApplicationManagerHost.Contract> contracts, org.j7m.middleware.application.api.ApplicationActivationRequest activationRequest)
    Creates a host around the application's real manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drain(Instant deadline)
    Closes admission and waits for admitted invocations before invoking the runtime drain hook.
    Reads actual application admission state.
    byte[]
    invoke(String requestId, String contract, byte[] payload, Instant deadline)
    Invokes a configured service contract; callers cannot select classes or methods.
    byte[]
    invokeRevision(String expectedRelease, String requestId, String contract, byte[] payload, Instant deadline)
    Invokes only when the admission gate still hosts the selected revision.
    void
    replace(ReleaseDescriptor release, Instant deadline)
    Replaces a drained instance using a verified trusted release and reopens admission.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ApplicationManagerHost

      public ApplicationManagerHost(String nodeId, org.j7m.middleware.api.MiddlewareRuntime runtime, org.j7m.middleware.deployer.ApplicationManager manager, org.j7m.middleware.application.repository.LocalApplicationRepository repository, org.j7m.middleware.application.repository.ArtifactRepositoryClient artifacts, Path staging, Map<String, ApplicationManagerHost.Contract> contracts, org.j7m.middleware.application.api.ApplicationActivationRequest activationRequest)
      Creates a host around the application's real manager.
      Parameters:
      nodeId - configured identity
      runtime - actual runtime
      manager - actual manager owning this application
      repository - actual manager repository
      artifacts - authenticated signed artifact source
      staging - private artifact staging directory
      contracts - fixed invocation aliases
      activationRequest - server-selected activation policy
  • Method Details

    • inspect

      public NodeView inspect()
      Reads actual application admission state.
      Specified by:
      inspect in interface HostingSupervisor
      Returns:
      hosted revision and admission counters
    • drain

      public void drain(Instant deadline) throws IOException
      Closes admission and waits for admitted invocations before invoking the runtime drain hook.
      Specified by:
      drain in interface HostingSupervisor
      Parameters:
      deadline - absolute deadline
      Throws:
      IOException - on incomplete drain
    • replace

      public void replace(ReleaseDescriptor release, Instant deadline) throws IOException
      Replaces a drained instance using a verified trusted release and reopens admission.
      Specified by:
      replace in interface HostingSupervisor
      Parameters:
      release - server-catalog release
      deadline - absolute deadline
      Throws:
      IOException - for verification or uncertain runtime replacement
    • invoke

      public byte[] invoke(String requestId, String contract, byte[] payload, Instant deadline) throws IOException
      Invokes a configured service contract; callers cannot select classes or methods.
      Specified by:
      invoke in interface ManagedInvocation
      Parameters:
      requestId - stable business request identity
      contract - server-configured contract alias
      payload - bounded opaque application bytes
      deadline - absolute deadline
      Returns:
      independent application result bytes
      Throws:
      IOException - unavailable, drained or unknown completion
    • invokeRevision

      public byte[] invokeRevision(String expectedRelease, String requestId, String contract, byte[] payload, Instant deadline) throws IOException
      Invokes only when the admission gate still hosts the selected revision.
      Specified by:
      invokeRevision in interface ManagedInvocation
      Parameters:
      expectedRelease - selected revision
      requestId - stable identity
      contract - configured alias
      payload - application bytes
      deadline - absolute deadline
      Returns:
      application response
      Throws:
      IOException - when revision pinning is unsupported or admission fails