Class ManagedOwnershipPolicy

java.lang.Object
org.j7m.middleware.application.distributed.ManagedOwnershipPolicy
All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.components.ManagedInvocationPolicy

public final class ManagedOwnershipPolicy extends Object implements org.j7m.middleware.application.components.ManagedInvocationPolicy, AutoCloseable
General D05/D06 ownership interceptor with finite host tenant/profile inventory. It acquires a real lease before body entry and supplies a per-claim provider context. Leadership is on-demand; no scheduler or arbitrary-effect fencing is implied. Renewal workers never run application code.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Safe aggregate host diagnostics without keys, identities or application values.

    Nested classes/interfaces inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy

    org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding, org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase, org.j7m.middleware.application.components.ManagedInvocationPolicy.Proceed
  • Constructor Summary

    Constructors
    Constructor
    Description
    ManagedOwnershipPolicy(Map<String, ManagedOwnershipProfile> profiles, Set<String> tenants, Function<org.j7m.middleware.application.api.InvocationContext, String> tenantResolver)
    Installs immutable trusted profiles with finite authenticated tenant mapping.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<Class<? extends Annotation>>
    org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding
    bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    void
    Stops new admission and closes executors only after actual invocation finalizers disposed all claims.
    org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase
    Returns finite aggregate maintenance state.
    void
    validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    void
    validateComponent(Class<?> component, boolean exported)
    void
    validateExposure(Class<?> component, Map<org.j7m.middleware.application.api.ManagedServiceContract, Class<?>> exports)

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy

    bindHosted, validateHosted, validateHostedExposure, validateHostedExposure
  • Constructor Details

    • ManagedOwnershipPolicy

      public ManagedOwnershipPolicy(Map<String, ManagedOwnershipProfile> profiles, Set<String> tenants, Function<org.j7m.middleware.application.api.InvocationContext, String> tenantResolver)
      Installs immutable trusted profiles with finite authenticated tenant mapping.
      Parameters:
      profiles - at most64 host policy names
      tenants - at most64 known tenant identities
      tenantResolver - maps the actual authenticated/host-bound context, never application arguments
      Throws:
      IllegalArgumentException - for invalid identities/capacities
      NullPointerException - for null configuration
  • Method Details

    • phase

      public org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase phase()
      Specified by:
      phase in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
    • annotationTypes

      public Set<Class<? extends Annotation>> annotationTypes()
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
    • validateComponent

      public void validateComponent(Class<?> component, boolean exported)
      Specified by:
      validateComponent in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
    • validateExposure

      public void validateExposure(Class<?> component, Map<org.j7m.middleware.application.api.ManagedServiceContract, Class<?>> exports)
      Specified by:
      validateExposure in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
    • validate

      public void validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
    • bind

      public org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
    • status

      Returns finite aggregate maintenance state.
      Returns:
      immutable redacted counters
    • close

      public void close()
      Stops new admission and closes executors only after actual invocation finalizers disposed all claims. In-flight USER work is never declared physically complete by policy close.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IllegalStateException - while actual claims still belong to invocations