Class PolledBindingCandidateSource

java.lang.Object
org.j7m.middleware.application.components.PolledBindingCandidateSource
All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.api.BindingCandidateSource

public final class PolledBindingCandidateSource extends Object implements org.j7m.middleware.application.api.BindingCandidateSource, AutoCloseable
Bounded production discovery adapter over MiddlewareRuntime.list. It does not reinterpret DiscoveryEvent diagnostics as a watch feed. Each subscription publishes full monotonically revised snapshots; failures publish a non-authoritative observation. Runtime ownership remains with the host. At most256 subscriptions share two daemon polling workers and finite timer slots.
  • Constructor Details

    • PolledBindingCandidateSource

      public PolledBindingCandidateSource(org.j7m.middleware.api.MiddlewareRuntime runtime)
      Creates a polling owner with a systemUTC expiration clock.
      Parameters:
      runtime - borrowed registry-capable runtime
    • PolledBindingCandidateSource

      public PolledBindingCandidateSource(org.j7m.middleware.api.MiddlewareRuntime runtime, Clock clock)
      Creates an owner with an explicit expiration clock.
      Parameters:
      runtime - borrowed registry-capable runtime
      clock - trusted expiration clock
  • Method Details

    • watch

      public AutoCloseable watch(org.j7m.middleware.application.api.ServiceBindingRequest<?> request, org.j7m.middleware.application.api.BindingPolicy policy, Consumer<org.j7m.middleware.application.api.BindingCandidates> observations)
      Specified by:
      watch in interface org.j7m.middleware.application.api.BindingCandidateSource
    • status

      Returns bounded aggregate discovery metrics.
      Returns:
      immutable source counters
    • close

      public void close()
      Revokes watchers and cancels polling without closing the borrowed runtime. In-flight bounded registry operations may finish; revoked bindings ignore their observations.
      Specified by:
      close in interface AutoCloseable