Class LiveServiceBindings

java.lang.Object
org.j7m.middleware.application.components.LiveServiceBindings
All Implemented Interfaces:
AutoCloseable

public final class LiveServiceBindings extends Object implements AutoCloseable
Trusted-host owner of at most256 live service bindings. Candidate authorization/readiness is mandatory and never inferred solely from metadata. Two bounded daemon workers coalesce callback snapshots; discovery ownership remains with the supplied source. This is target selection, not an invocation retry, transaction, credential carrier or durable deduplication service.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Safe aggregate lifecycle information.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline)
    Creates a trusted host owner; no allow-all admission or implicit deadline is supplied.
    LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline, org.j7m.middleware.application.api.ClientCallInterceptor interceptor)
    Creates a binding owner with an explicit trusted dependency-call interceptor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes handles and revokes queued observers without closing borrowed source/runtime.
    <T> org.j7m.middleware.application.api.ServiceBinding<T>
    open(org.j7m.middleware.application.api.ServiceBindingRequest<T> request, String policyName)
    Opens a finite live handle.
    org.j7m.middleware.application.api.BindingPolicy
    policy(String name)
    Returns an immutable host policy for adapter prevalidation without discovery or application work.
    Returns aggregate counters without candidate, credential or qualifier labels.

    Methods inherited from class Object

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

    • LiveServiceBindings

      public LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline)
      Creates a trusted host owner; no allow-all admission or implicit deadline is supplied.
      Parameters:
      source - borrowed bounded candidate source
      connector - borrowed exact-reference connector without HA retry
      admission - trusted bounded authorization/readiness check, thread-safe and no principal mutation
      localRuntime - local runtime identity for PREFER_LOCAL
      policies - immutable named policies, at most256; names are safe identifiers
      callerDeadline - current caller absolute deadline; also capped by policy budget
      Throws:
      IllegalArgumentException - for malformed policy names/capacity
    • LiveServiceBindings

      public LiveServiceBindings(org.j7m.middleware.application.api.BindingCandidateSource source, org.j7m.middleware.application.api.BindingConnector connector, org.j7m.middleware.application.api.BindingAdmission admission, String localRuntime, Map<String, org.j7m.middleware.application.api.BindingPolicy> policies, Supplier<Instant> callerDeadline, org.j7m.middleware.application.api.ClientCallInterceptor interceptor)
      Creates a binding owner with an explicit trusted dependency-call interceptor. The default constructor retains one attempt; annotations never install this interceptor.
      Parameters:
      source - borrowed candidate source
      connector - borrowed exact-reference read-only connector
      admission - trusted authorization/readiness callback
      localRuntime - local runtime identity
      policies - finite named binding policies
      callerDeadline - current caller deadline, also bounded by binding policy
      interceptor - trusted host policy; must preserve pinned identity and physical-call safety
      Throws:
      IllegalArgumentException - for invalid policy names/capacity
  • Method Details

    • policy

      public org.j7m.middleware.application.api.BindingPolicy policy(String name)
      Returns an immutable host policy for adapter prevalidation without discovery or application work.
      Parameters:
      name - registered policy ID
      Returns:
      immutable policy
      Throws:
      IllegalArgumentException - if the policy is unknown
    • open

      public <T> org.j7m.middleware.application.api.ServiceBinding<T> open(org.j7m.middleware.application.api.ServiceBindingRequest<T> request, String policyName)
      Opens a finite live handle. Required policies establish an initial target within budget. OPTIONAL policies allow initial absence and must be consumed through optionalProvider().
      Type Parameters:
      T - ordinary business contract
      Parameters:
      request - exact contract/version/qualifier request
      policyName - host policy ID
      Returns:
      owned live handle
      Throws:
      org.j7m.middleware.api.MiddlewareException - for unavailable targets or exhausted capacity
      IllegalArgumentException - for unknown policies
    • status

      public LiveServiceBindings.Status status()
      Returns aggregate counters without candidate, credential or qualifier labels.
      Returns:
      bounded owner status
    • close

      public void close()
      Closes handles and revokes queued observers without closing borrowed source/runtime. In-flight calls keep their captured target and are neither replayed nor claimed undone.
      Specified by:
      close in interface AutoCloseable